0% found this document useful (0 votes)
16 views

How To Configure Ems Kafka Bridge

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

How To Configure Ems Kafka Bridge

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

TIBCO Software Inc.

Global Headquarters
3307 Hillview Avenue
Palo Alto, CA 94304 How to Bridge TIBCO Enterprise
Tel: +1 650-846-1000 Message Service™ and Apache
Toll Free: 1 800-420-8450
Fax: +1 650-846-1005
Kafka® with TIBCO FTL®
www.tibco.com This document provides the steps for configuring and testing the
bridge between TIBCO Enterprise Message Service, TIBCO FTL, and
Apache Kafka

Version 2.0 February 2022 Document


rewritten for
current version
of EMS, FTL,
and Apache
Kafka

TIBCO fuels digital business


by enabling better decisions
and faster, smarter actions
through the TIBCO
Connected Intelligence
Cloud. From APIs and
systems to devices and
people, we interconnect
everything, capture data in
real time wherever it is, and
augment the intelligence of
your business through
analytical insights.
Thousands of customers
around the globe rely on us
to build compelling
experiences, energize
operations, and propel
innovation. Learn how
TIBCO makes digital smarter
at www.tibco.com.
Copyright Notice
COPYRIGHT© 2022 TIBCO Software Inc. All rights reserved.

Trademarks
TIBCO and the TIBCO logo are either registered trademarks or trademarks of TIBCO Software Inc. in the
United States and/or other countries. All other product and company names and marks mentioned in this
document are the property of their respective owners and are mentioned for identification purposes only.

Content Warranty
The information in this document is subject to change without notice. THIS DOCUMENT IS PROVIDED "AS
IS" AND TIBCO MAKES NO WARRANTY, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT
NOT LIMITED TO ALL WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE. TIBCO Software Inc. shall not be liable for errors contained herein or for incidental or
consequential damages in connection with the furnishing, performance or use of this material.

For more information, please contact:

TIBCO Software Inc.


3303 Hillview Avenue
Palo Alto, CA 94304
USA

©2022 TIBCO Software Inc. All Rights Reserved. 2


Table of Contents
1 Overview ........................................................................................................................................ 5
1.1 Document Purpose.............................................................................................................................. 5
1.2 Linux Kernel Version Support .............................................................................................................. 5
1.3 Product/Component Version Support ................................................................................................ 5
1.4 Assumptions ........................................................................................................................................ 5
2 Messaging Component Installation and Configuration ................................................................ 7
2.1 Component Installation ....................................................................................................................... 7
2.2 Post Installation................................................................................................................................... 7
2.3 TIBCO Enterprise Message Service Configuration ............................................................................... 7
2.3.1 Tibemsd.conf ................................................................................................................................... 7
2.3.2 Transports.conf ............................................................................................................................... 8
2.3.3 Topics.conf ...................................................................................................................................... 9
2.3.4 Queues.conf and Bridges.conf ........................................................................................................ 9
2.4 TIBCO FTL Configuration ..................................................................................................................... 9
2.4.1 Start the FTL Server ......................................................................................................................... 9
2.4.2 Configure the FTL Server ............................................................................................................... 10
2.4.3 Start the EMS Server ..................................................................................................................... 12
2.5 Kafka Bridge Configuration ............................................................................................................... 13
2.5.1 Configure Zookeeper and the Kafka Broker .................................................................................. 13
2.5.2 Configuring the TIBCO-Kafka Sink and Source Connectors ........................................................... 13
2.5.3 Starting the Bridge Connectors ..................................................................................................... 14
2.5.4 Create the Kafka Topic .................................................................................................................. 14
3 Testing the Kafka – FTL Bridge..................................................................................................... 16
3.1 Sending Messages from EMS ............................................................................................................ 16
3.1.1 Setting Up the EMS Send Tests ..................................................................................................... 16
3.1.2 Expected Results ........................................................................................................................... 17
3.2 Sending Messages from Kafka........................................................................................................... 18
3.2.1 Setting up the Kafka Send Test ..................................................................................................... 18
3.2.2 Expected Results ........................................................................................................................... 19

©2022 TIBCO Software Inc. All Rights Reserved. 3


Table of Figures

FIGURE 1 - /ETC/PROFILE ADDITIONS ......................................................................................................................................... 7


FIGURE 2 - TIBEMSD.CONF MODIFICATIONS ................................................................................................................................. 8
FIGURE 3 -TRANSPORTS.CONF MODIFICATIONS ............................................................................................................................ 9
FIGURE 4 - TOPICS.CONF MODIFICATIONS ................................................................................................................................... 9
FIGURE 5 - QUEUES.CONF EXAMPLE ........................................................................................................................................... 9
FIGURE 6 - BRIDGES.CONF EXAMPLE........................................................................................................................................... 9
FIGURE 7 - RUNNING FTL ENVIRONMENT ................................................................................................................................. 10
FIGURE 8 - FTL CONFIGURATION ............................................................................................................................................. 12
FIGURE 9 - EMS STARTUP EXAMPLE ........................................................................................................................................ 13
FIGURE 10 - FTL OUTPUT FROM EMS SEND ............................................................................................................................. 17
FIGURE 11 - KAFKA OUTPUT FROM EMS SEND ......................................................................................................................... 18
FIGURE 12 – FTL OUTPUT FROM KAFKA SEND .......................................................................................................................... 19
FIGURE 13 - EMS OUTPUT FROM KAFKA SEND .......................................................................................................................... 20

©2022 TIBCO Software Inc. All Rights Reserved. 4


1 Overview

1.1 Document Purpose

TIBCO Messaging provides connectors to bridge TIBCO FTL and Apache Kafka. The purpose of
the document is to provide a guide on how to install, configure, and test the TIBCO bridge between
TIBCO FTL, and Apache Kafka. Although there is no direct bridge from TIBCO Enterprise
Message Service (EMS) and Apache Kafka, TIBCO EMS and TIBCO FTL also can be bridged.
This guide will provide the steps necessary for configuring the bridge between TIBCO Enterprise
Message Service and TIBCO FTL, thus allowing messages to be sent/received from TIBCO EMS
to Apache Kafka.
The document will outline:
• Configuration of EMS to bridge to FTL
• Configuration of FTL to bridge to Apache Kafka
• Configuration of a bidirectional tibftl-connector to bridge Kafka and FTL for simple string
messages
• Simple tests to ensure bidirectional message transfer between EMS/FTL and Kafka. For
sending/receiving more complex message structures between the components, refer to the
appropriate TIBCO messaging component documentation.

1.2 Linux Kernel Version Support

This document covers the installation and configuration of EMS, FTL, and Kafka on Linux. This
document is based on RedHat/CentOS 7.9 Linux.
However, other Linux kernels can be used as well as MacOS, so long as they are supported
versions by the TIBCO Messaging components and Apache Kafka.
Note: Configuration for other operating systems is not provided as part of this document.

1.3 Product/Component Version Support

• TIBCO Enterprise Message Service – version 10.1 or later is required


• TIBCO FTL – version 6.7.2 or later is required
• Apache Kafka – version 3.0 (TIBCO Distribution) or later
• TIBCO Messaging - Bridge for Apache Kafka - Enterprise Edition Software - version 2.3
or later

1.4 Assumptions

• The reader of this document is familiar with the following concepts:


o TIBCO product installation and configuration of EMS and FTL in Linux or MacOS
environments
o Installation and configuration of Apache Kafka in Linux or MacOS environments

©2022 TIBCO Software Inc. All Rights Reserved. 5


• Java development is installed
• All TIBCO messaging components are installed on the same server
• Document only provides information for Red Hat Linux. Other Linux kernels should be
similar

©2022 TIBCO Software Inc. All Rights Reserved. 6


2 Messaging Component Installation and Configuration

The following steps will outline installing and configuring TIBCO Messaging, which includes
TIBCO EMS, TIBCO FTL, and Apache Kafka – TIBCO Distribution (AKD).

2.1 Component Installation

TIBCO EMS, FTL, and AKD should all be installed following their respective installation guides.
All components are part of the TIBCO Messaging - Enterprise Edition which can be download
from https://edelivery.tibco.com or TIBCO Messaging - Community Edition which can be
downloaded from https://www.tibco.com/products/tibco-messaging/downloads. There are no
special installation requirements.

2.2 Post Installation

Follow the post installation steps for each of the respective messaging component. Once
completed, it is recommended to update the /etc/profile with the following:

# following are for the TIBCO Messaging Components


#
export TIBCO_HOME=/opt/tibco
#
# For FTL
#
export PATH=$TIBCO_HOME/ftl/current-version/bin:$PATH
export LB_LIBRARY_PATH=$TIBCO_HOME/ftl/current-version/lib:$LD_LIBRARY_PATH
#
# For Kafka
#
export KAFKA_OPTS=”-Djava.library.path=$TIBCO_HOME/ftl/current-version/lib”
export CLASSPATH=$CLASSPATH:/$TIBCO_HOME/ftl/current-version/lib/tibftl.jar”
#
Figure 1 - /etc/profile additions

2.3 TIBCO Enterprise Message Service Configuration

Once TIBCO Enterprise Message Service (EMS) has been installed, the component can be
configured for the bridge to TIBCO FTL. The tibemsd, transports, bridges, queues, and topics
configuration files require modifications.
Note: This document will show updating the conf versions of the EMS configuration files. If using
Json, update accordingly.
Note: Do not start EMS after making the EMS configuration file changes. Wait until FTL has been
started and configured.

2.3.1 Tibemsd.conf
The tibemsd.conf must be updated to enable the tibftl_transport , module_path, and the FTL URL.
©2022 TIBCO Software Inc. All Rights Reserved. 7
Note: username,password,trustfile, and loglevel can also be set, if required.

Set/add:
● tibftl_transports = enabled
● module_path = <EMS_HOME>/ems/10.1/lib/:/<FTL_HOME>/ftl/6.7/lib
● ftl_url = The FTL URL <http://localhost:8585>

Note: Take note of the name of the EMS Server. The default is EMS-SERVER

The following example shows the modifications:

tibftl_transports = enabled

########################################################################
# FTL setup. These global parameters are used only when FTL transports
# are enabled, and apply to all FTL transports. The "ftl_url" parameter
# is required when FTL transports are enabled.
# The "ftl_trustfile" parameter is required when using a TLS
# connection to FTL and validating the FTL server.
########################################################################
ftl_url = http://localhost:8585
ftl_username =
ftl_password =
ftl_trustfile =
ftl_log_level = warn

########################################################################

Figure 2 - tibemsd.conf modifications

2.3.2 Transports.conf
Transports.conf must be updated to include a new reference for a new transport type. In this case,
FTL. Once the tibftl_transports is enabled in tibemsd.conf, TIBCO EMS expects the
transports.conf to reference an FTL definition. The tibftl type must be defined, along with an ftl
endpoint. There are other possible parameters, but at a minimum, the tibftl type and FTL endpoint
must be defined. The following shows an example of what should be added to transports.conf to
import messages to a topic and persisted queue.
[FTLtopic]
type = tibftl
endpoint = FTLtopic

[FTLqueuein]
type = tibftl
endpoint = FTLqueuein
queue_import_dm = TIBEMS_PERSISTENT

[FTLqueueout]
type = tibftl
endpoint = FTLqueueout

©2022 TIBCO Software Inc. All Rights Reserved. 8


Figure 3 -transports.conf modifications

2.3.3 Topics.conf
The topics.conf configuration file requires modifications to support the FTL bridge. Topics.conf
must be updated to include the topics which will be used to import and export messages to FTL.
The new topics and the FTL endpoints will then be used to import/export messages between EMS
and FTL.
Note: in the following example, two topics are created/used. The ftltopic topic is used to import
and export messages, while the ftlqueueout topic is only used for exports. The topic ftltopic is not
used in the test, but show how to setup a simple topic for use in EMS/FTL bridging.
ftltopic import="FTLtopic",export="FTLtopic"
ftlqueueout export="FTLqueueout"

Figure 4 - topics.conf modifications

2.3.4 Queues.conf and Bridges.conf


Queues are also used to import messages from FTL. In addition, the queues can be persisted.
Figure 3 provides an example of configuring transports.conf to import messages to a persisted
queue.
However, queues cannot export messages to FTL. If a persistent queue is used to send messages to
FTL, a bridge must be configured to bridge the queue to the topic exporting messages to FTL. The
examples below show the queue definitions for importing and exporting messages FTL, and the
bridge definition.
ftlqueuein import="FTLqueuein",store=$sys.failsafe
ftlqueueout store=$sys.failsafe,expiration=5

Figure 5 - queues.conf example

[queue:ftlqueueout]
topic=ftlqueueout
Figure 6 - bridges.conf example

Note: Messages sent to a bridged queue are not removed after being exported to FTL, and must be
manually purged if an expiration time is not defined.

2.4 TIBCO FTL Configuration

The FTL configuration setup for testing the FTL-EMS bridge is done via the FTL URL. Use the
following to setup the FTL configuration to create the FTL-EMS bridge, the Kafka-FTL bridge.

2.4.1 Start the FTL Server


An existing FTL environment can be used, or a new FTL environment can be used. In this
document, the FTL server provided in the samples/scripts directory will be used. The FTL Server
will be started on port 8585on the localhost.
• Change directory to $TIBCO_HOME/ftl/current-version/samples
• . ./setup

©2022 TIBCO Software Inc. All Rights Reserved. 9


• Change directory to scripts
• Use ./ftlstart ftl1@localhost:8585 to start the FTL Server
• Verify FTL is running. There should be four FTL processes running. Resolve any issues
before continuing.
502 2706 1 0 4:49PM ttys003 1:42.28 /opt/tibco/ftl/current-
version/samples/../bin/tibftlserver -n ftl1 -c /var/tmp/ftlstart_ftl_2691.yaml
502 2708 2706 0 4:49PM ttys003 5:42.95 /opt/tibco/ftl/6.7/bin/tibmux --realmserver
http://127.0.0.1:8585 --client-label ftl.ftl1 --external-address ftl1@localhost:8585 --bind-address
localhost:8585 --peer-muxes ftl1@localhost:8585 --trace warn
502 2710 2706 0 4:49PM ttys003 14:37.24 /opt/tibco/ftl/6.7/bin/tibrserver --server.label
realm.ftl1 --data /ftl-server/ftl1 --http 127.0.0.1:0 --ftl localhost:0 --gui 127.0.0.1:0 --
server.user primary --server.password primary-pw --client.url http://127.0.0.1:8585 --
ftlserver.urls ftl1@localhost:8585 --ftlserver.name ftl1 --external.address localhost:8585
502 2713 2706 0 4:49PM ttys003 2:25.85 /opt/tibco/ftl/6.7/bin/tibpserver --name
default_ftl1 --data /ftl-server/ftl1 --realmserver http://127.0.0.1:8585

Figure 7 - Running FTL environment

2.4.2 Configure the FTL Server


The section will show how to configure the FTL Server for EMS and Kafka. It will outline creating
transports, applications, endpoints, and durables.
• In a web browser, go to the FTL URL. In the above examples, http://localhost:8585
• Click on the Edit Mode button, slide it to on.
• Create two new transports. Click on Transports, then click on the + next to Transports, to
create a new transport,
o Leave Group blank, enter a new transport name. Provide a name which represents
its use, such as queuein or queueout
o Use Dynamic TCP from the drop down menu for the Transport Type
o Create a second transport. It should also be Dynamic TCP
• Once the transports have been created, the applications can be created. Three applications
will be created. One for the EMS bridge, and the other two for the Kafka bridge (sink and
source).
• Create a new application for the EMS Bridge,
o The name of the application must be the same as the name of the EMS Server.
Default is EMS-SERVER. In the following example, EMS-SERVER is the
application name and the name of the EMS server.
o Three endpoints need to be created. These need to match the endpoint names from
the EMS transports.conf. From the transports.conf example, create FTLtopic,
FTLqueuein, and FTLqueueout
o Use ftl.default.cluster for all three endpoints.
o For the FTLqueuein and FTLqueueout endpoints, use ftl.persistent.store for the
store, and ftl.standard.template for the durable template.
o For the FTLtopic endpoint, use, ftl.nonpersistent.store for the store, and
ftl.pubsub.template for the durable template.
o For the transports, use server for the FTLtopic endpoint, use queuein for the
FTLqueuein endpoint, and queueout for the FTLqueueout endpoint.
o Leave the other columns at their default.

©2022 TIBCO Software Inc. All Rights Reserved. 10


• Create the Kafka applications in FTL. The two Kafka-FTL bridge applications are created
similar to the EMS Bridge application
o For the Kafka-FTL source bridge, the application name must match the name
defined for the ftl.application.name property in the ftl-source.yaml file discussed in
the next section. The default it is kafka-connect-source.
o The endpoint for the source bridge application should be FTLqueueout, the cluster is
ftl.default.cluster, the store is ftl.persistent.store, and the durable template should be
ftl.standard.template. The transport should be queueout, and the protocol should be
Dynamic TCP. Leave all other columns at their default.
o For the Kafka-FTL sink bridge, the application name must match the name defined
for the ftl.application.name property in the ftl-sink.yaml file discussed in the next
section. The default is kafka-connect-sink.
o The endpoint for the sink bridge application should be FTLqueuein, the cluster is
ftl.default.cluster, the store is ftl.persistent.store, and the durable template should be
ftl.standard.template. The transport should be queuein and the protocol should be
Dynamic TCP. Leave all other columns at their default.
• After verifying all required applications, endpoints, and transports have been configured,
the configuration can be deployed. Click on Deploy at the top of the FTL main screen. Use
test to validate the configuration. Fix any problems that listed (if any), then deploy the
configuration. Click Done.
After all three applications have been deployed, the FTL configuration should be similar to the
figure below.

©2022 TIBCO Software Inc. All Rights Reserved. 11


Figure 8 - FTL configuration

2.4.3 Start the EMS Server


After FTL has started and configured, start the EMS Server instance, using the modified EMS
tibemsd.conf configuration file. Review the EMS log after EMS starts. The creation of the FTL
transports should be observed with no errors, and the EMS server should be active.
TIBCO Enterprise Message Service Enterprise Edition.
Copyright 2003-2021 by TIBCO Software Inc.
All rights reserved.

Version 10.1.0 V4 11/9/2021

2022-02-07 12:26:30.414 Process started from '../bin/tibemsd'.


2022-02-07 12:26:30.415 Process Id: 59165
2022-02-07 12:26:30.415 Hostname: xxxx.local
2022-02-07 12:26:30.415 Hostname IP address: 127.0.0.1
2022-02-07 12:26:30.415 Hostname IP address: 127.0.0.1
2022-02-07 12:26:30.415 Reading configuration from 'tibemsd.conf'.
2022-02-07 12:26:30.418 Server name: 'EMS-SERVER'.
2022-02-07 12:26:30.418 Storage Location: 'datastore'.
2022-02-07 12:26:30.418 Routing is disabled.
2022-02-07 12:26:30.418 Authorization is disabled.
2022-02-07 12:26:30.418 The server will attempt to trace warnings about destinations that are
growing unbounded above 26843545 bytes or 50000 messages.
2022-02-07 12:26:30.418 Set server properties 'large_destination_memory' and
'large_destination_count' respectively to alter these thresholds.
2022-02-07 12:26:30.425 Accepting connections on tcp://xxxx:7222.
2022-02-07 12:26:30.425 Recovering state, please wait.
2022-02-07 12:26:30.427 Recovered 10 messages.

©2022 TIBCO Software Inc. All Rights Reserved. 12


2022-02-07 12:26:30.473 Created TIBCO FTL transport 'FTLqueueout'
2022-02-07 12:26:30.473 Created TIBCO FTL transport 'FTLtopic'
2022-02-07 12:26:30.474 Created TIBCO FTL transport 'FTLqueuein'
2022-02-07 12:26:30.479 Server is active.

Figure 9 - EMS Startup example

FTL and EMS are now bridged to send/receive messages between the components.

2.5 Kafka Bridge Configuration

Once the FTL and EMS components are configured and bridged, the TIBCO Kafka-FTL bridge
can be configured. There are two connectors; source and sink. The source connector is used to
publish messages to Kafka from FTL, and the sink connector will provide the ability to publish
messages from Kafka to FTL. First configure and start the Kafka components.

2.5.1 Configure Zookeeper and the Kafka Broker


To use the TIBCO Kafka-FTL bridge, both Zookeeper and the Kafka Broker are required. This
section will outline the steps to configure/start Zookeeper and the Broker.
● Change directory $TIBCO_HOME/akd/core
● Edit config/zookeeper.properties, if required. Take note of the Zookeeper client port. The
default is 2181.
● Start Zookeeper in the background using the following command:
bin/zookeeper-server-start.sh –daemon config/zookeeper.properties
● Edit config/server.properties, if required, and set or take note of the listener(s) for the
Broker listening port. The default is 9092.
● Start the Kafka Broker in the background using the following command:
bin/kafka-server-start.sh –daemon config/server.properties
● Verify both processes are running

2.5.2 Configuring the TIBCO-Kafka Sink and Source Connectors


The connectors requires the following property files to be updated:
● $TIBCO_HOME/akd/bridge/2.3/config/connect-standalone.properties
● $TIBCO_HOME/akd/bridge/2.3/config/tibftl-kafka-connect-source.properties
● $TIBCO_HOME/akd/bridge/2.3/config/tibftl-kafka-connect-sink.properties
● $TIBCO_HOME/akd/bridge/2.3/config/ftl-source.yaml
● $TIBCO_HOME/akd/bridge/2.3/config/ftl-sink.yaml

Follow the TIBCO Messaging -Installation and Configuration Guides for details on configuring
these properties files. It is recommended that copies be made of both files before editing.

2.5.2.1 Connect-standalone Properties file


The connect-standalone.properties file can be modified to meet the requirements, such as if a
schema repo should be used. However, for the basic connectors to work, the properties file should
only need to be modified for the bootstrap.servers and the plugin path.

©2022 TIBCO Software Inc. All Rights Reserved. 13


If the Kafka broker is running on the server as the connectors, and is using the default port. (9092),
no changes should be required for the Kafka broker.
The plugin.path must be updated for the path to the bridge/lib directory, as shown in the following
example:

plugin.path=/opt/tibco/akd/bridge/2.3/lib

2.5.2.2 Tibftl Source and Sink Connector Properties


The tibftl-kafka-connect-source.properties and tibftl-kafka-connect-sink.properties files only
require two changes:
• The location of the ftl sink/source yaml files. In most situations, this should
/opt/tibco/akd/bridge/2.3/config.
• The Kafka topic. The source should be ftlout, while the sink should be ftlin.
2.5.2.3 FTL Sink/Source Yaml files
If the defaults are used for the FTL Realm URL, and FTL Application no modifications are
required. If any of the values differ, update the yaml file with the appropriate values.
The endpoint must be the same as defined when configuring FTL. FTLqueuein for the sink, and
FTLqueueout for the source.
In general, ensure that application and endpoints match what is configured in FTL.
2.5.3 Starting the Bridge Connectors
Once the connectors are configured, they can be started. To start the connectors, go to the
/opt/tibco/akd/bridge/2.3/config directory (Should already be there). Use:
/opt/tibco/akd/core/bin/connect-standalone.sh connect-standalone.properties
tibftl-kafka-connect-sink.properties tibftl-kafka-connect-source.properties

Both connectors should start with no errors.


Note: The startup is very “chatty”, and there will be many lines out output. However, there should
be no errors. Resolve any errors before continuing.

If both connectors start up correctly, use the following to startup the connectors in the background:

/opt/tibco/akd/core/bin/connect-standalone.sh -daemon connect-


standalone.properties tibftl-kafka-connect-sink.properties tibftl-kafka-
connect-source.properties

2.5.4 Create the Kafka Topic


The final configuration step is create the topics in Kafka for the connectors. Use the following to
create two new topics.

/opt/tibco/akd/core/bin/kafka-topics.sh --bootstrap-server localhost:9092 --


create --topic ftlin --replication-factor 1 --partitions 1

©2022 TIBCO Software Inc. All Rights Reserved. 14


/opt/tibco/akd/core/bin/kafka-topics.sh --bootstrap-server localhost:9092 --
create --topic ftlout --replication-factor 1 --partitions 1

©2022 TIBCO Software Inc. All Rights Reserved. 15


3 Testing the Kafka – FTL Bridge

This section will outline simple tests of the connectors to ensure messages sent/received between
Kafka and FTL, and FTL and EMS. Tests will show sending messages from EMS via FTL to
Kafka, and sending message from Kafka to EMS via FTL.

3.1 Sending Messages from EMS

In this section, EMS will send messages via FTL to Kafka. The EMS sample java application
tibjmsMsgProducer, FTL sample program tibrecvex, and the Kafka kafka-connect-consumer.sh
script will be used to test the bridge between the messaging components.
3.1.1 Setting Up the EMS Send Tests
For these tests, the Kafka topic is ftlout, the FTL application is kafka-connect-source, the FTL
endpoint is FTLqueueout, and the EMS topic or queue ftlqueueout are used.

Start the FTL receiver test program. In the following example, the FTL Server is running
http://localhost:8585, the endpoint is FTLqueueout, the FTL application is EMS_SERVER, and the
message count to receive is 5.
/opt/tibco/ftl/6.7/samples/bin/advanced/tibrecvex -a EMS-SERVER -e FTLqueueout -c 5
http://localhost:8585
#
# ./tibrecvex
#
# TIBCO FTL Version 6.7.2 V7
#
Invoked as: ./tibrecvex -a EMS-SERVER -e FTLqueueout -c 5 http://localhost:8585
waiting for message(s)

Start the Kafka consumer script. In the following example, the Kafka Server is running on
localhost:9092, and is listening for messages on the ftlout topic.
/opt/tibco/akd/core/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ftlout

Finally, run the EMS sample java application, tibjmsMsgProducer to send five messages to FTL.
In the following example, the EMS server is running at tcp://7222, and the topic is ftlqueueout.
cd /opt/tibco/ems/10.1/samples/java
. ./setup.sh
java tibjmsMsgProducer -server tcp://7222 -topic ftlqueueout message1 message2 message3 message4
message5

------------------------------------------------------------------------
tibjmsMsgProducer SAMPLE
------------------------------------------------------------------------
Server....................... tcp://7222
User......................... (null)
Destination.................. ftlqueueout
Send Asynchronously.......... false
Message Text.................
message1
message2
message3

©2022 TIBCO Software Inc. All Rights Reserved. 16


message4
message5
------------------------------------------------------------------------

Publishing to destination 'ftlqueueout'

Published message: message1


Published message: message2
Published message: message3
Published message: message4
Published message: message5

3.1.2 Expected Results


After the TIBCO EMS publisher has sent the five messages, both the TIBCO FTL receiver
program and the Kafka consumer script should receive the five messages. The output should be
similar to the following. If FTL does not receive the messages, Kafka will not. Check the EMS and
FTL bridge configuration. If FTL receives the messages, but Kafka does not, check the connector
properties for problems.

FTL:
Invoked as: ./tibrecvex -a EMS-SERVER -e FTLqueueout -c 5 http://localhost:8585
waiting for message(s)
received message 1
message:
{string:_text="message1", long:_emshdr:JMSDeliveryMode=2, long:_emshdr:JMSPriority=4,
string:_emshdr:JMSMessageID="ID:EMS-SERVER.E71D620164562D:1",
long:_emshdr:JMSTimestamp=1644337687165, long:_emshdr:JMSDeliveryTime=1644337687165,
string:_emshdr:JMSDestination="TOPIC:ftlqueueout"}
received message 2
message:
{string:_text="message2", long:_emshdr:JMSDeliveryMode=2, long:_emshdr:JMSPriority=4,
string:_emshdr:JMSMessageID="ID:EMS-SERVER.E71D620164562D:2",
long:_emshdr:JMSTimestamp=1644337687165, long:_emshdr:JMSDeliveryTime=1644337687165,
string:_emshdr:JMSDestination="TOPIC:ftlqueueout"}
received message 3
message:
{string:_text="message3", long:_emshdr:JMSDeliveryMode=2, long:_emshdr:JMSPriority=4,
string:_emshdr:JMSMessageID="ID:EMS-SERVER.E71D620164562D:3",
long:_emshdr:JMSTimestamp=1644337687166, long:_emshdr:JMSDeliveryTime=1644337687166,
string:_emshdr:JMSDestination="TOPIC:ftlqueueout"}
received message 4
message:
{string:_text="message4", long:_emshdr:JMSDeliveryMode=2, long:_emshdr:JMSPriority=4,
string:_emshdr:JMSMessageID="ID:EMS-SERVER.E71D620164562D:4",
long:_emshdr:JMSTimestamp=1644337687166, long:_emshdr:JMSDeliveryTime=1644337687166,
string:_emshdr:JMSDestination="TOPIC:ftlqueueout"}
received message 5
message:
{string:_text="message5", long:_emshdr:JMSDeliveryMode=2, long:_emshdr:JMSPriority=4,
string:_emshdr:JMSMessageID="ID:EMS-SERVER.E71D620164562D:5",
long:_emshdr:JMSTimestamp=1644337687166, long:_emshdr:JMSDeliveryTime=1644337687166,
string:_emshdr:JMSDestination="TOPIC:ftlqueueout"}

Figure 10 - FTL Output from EMS Send

Kafka:
/opt/tibco/akd/core/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ftlout
{"_text":"message1","_emshdr:JMSDeliveryMode":2,"_emshdr:JMSPriority":4,"_emshdr:JMSMessageID":"ID:
EMS-
SERVER.E71D620164562D:1","_emshdr:JMSTimestamp":1644337687165,"_emshdr:JMSDeliveryTime":16443376871
65,"_emshdr:JMSDestination":"TOPIC:ftlqueueout"}
{"_text":"message2","_emshdr:JMSDeliveryMode":2,"_emshdr:JMSPriority":4,"_emshdr:JMSMessageID":"ID:
EMS-

©2022 TIBCO Software Inc. All Rights Reserved. 17


SERVER.E71D620164562D:2","_emshdr:JMSTimestamp":1644337687165,"_emshdr:JMSDeliveryTime":16443376871
65,"_emshdr:JMSDestination":"TOPIC:ftlqueueout"}
{"_text":"message3","_emshdr:JMSDeliveryMode":2,"_emshdr:JMSPriority":4,"_emshdr:JMSMessageID":"ID:
EMS-
SERVER.E71D620164562D:3","_emshdr:JMSTimestamp":1644337687166,"_emshdr:JMSDeliveryTime":16443376871
66,"_emshdr:JMSDestination":"TOPIC:ftlqueueout"}
{"_text":"message4","_emshdr:JMSDeliveryMode":2,"_emshdr:JMSPriority":4,"_emshdr:JMSMessageID":"ID:
EMS-
SERVER.E71D620164562D:4","_emshdr:JMSTimestamp":1644337687166,"_emshdr:JMSDeliveryTime":16443376871
66,"_emshdr:JMSDestination":"TOPIC:ftlqueueout"}
{"_text":"message5","_emshdr:JMSDeliveryMode":2,"_emshdr:JMSPriority":4,"_emshdr:JMSMessageID":"ID:
EMS-
SERVER.E71D620164562D:5","_emshdr:JMSTimestamp":1644337687166,"_emshdr:JMSDeliveryTime":16443376871
66,"_emshdr:JMSDestination":"TOPIC:ftlqueueout"}

Figure 11 - Kafka Output from EMS Send

3.2 Sending Messages from Kafka

Now that sending messages from EMS via FTL to Kafka, has been tested, messages sent from
Kafka to EMS can be tested. The Kafka kafka-console-producer.sh script, FTL sample program
tibrecvex, and the EMS sample java application tibjmsMsgConsumer will be used to test the bridge
between the messaging components.
3.2.1 Setting up the Kafka Send Test
For these tests, the Kafka topic is ftlin, the FTL endpoint is FTLqueuein, and the EMS queue is
ftlqueuein will be used.
Start the FTL receiver test program. In the following example, the FTL Server is running on
http://localhost:8585, the endpoint is FTLqueuein, the FTL application is EMS_SERVER, and the
message count to receive is 5.
/opt/tibco/ftl/6.7/samples/bin/advanced/tibrecvex -a EMS-SERVER -e FTLqueuein -c 5
http://localhost:8585
#
# ./tibrecvex
#
# TIBCO FTL Version 6.7.2 V7
#
Invoked as: ./tibrecvex -a EMS-SERVER -e FTLqueuein -c 5 http://localhost:8585
waiting for message(s)

Start the EMS consumer java application. In the following example, the EMS server is running at
tcp://7222, and the queue ftlqueuein.
cd /opt/tibco/ems/10.1/samples/java
. ./setup.sh
java tibjmsMsgConsumer -server tcp://7222 -queue ftlqueuein

------------------------------------------------------------------------
tibjmsMsgConsumer SAMPLE
------------------------------------------------------------------------
Server....................... tcp://7222
User......................... (null)
Destination.................. ftlqueuein
------------------------------------------------------------------------

Subscribing to destination: ftlqueuein

©2022 TIBCO Software Inc. All Rights Reserved. 18


Finally, run the Kafka producer script, kafka-console-producer.sh, and send five messages. In the
following example, the Kafka Server is running on localhost:9092, and is sending messages on the
ftlin topic.
/opt/tibco/akd/core/bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic ftlin
>{"text":"message1"}
>{"text":"message2"}
>{"text":"message3"}
>{"text":"message4"}
>{"text":"message5"}

3.2.2 Expected Results


After the Kafka publisher script has been used to send five messages {“text”:”message”}, both the
TIBCO FTL receiver program and the TIBCO EMS consumer java application should receive the
five messages. The output should be similar to the following. If FTL does not receive the
messages, EMS will not. Check the connector properties for problems. If FTL receives the
messages, but EMS does not, check the EMS and FTL bridge configuration.
FTL:
#
# ./tibrecvex
#
# TIBCO FTL Version 6.7.2 V7
#
Invoked as: ./tibrecvex -a EMS-SERVER -e FTLqueuein -c 5 http://localhost:8585
waiting for message(s)
received message 1
message:
{string:text="message1"}
received message 2
message:
{string:text="message2"}
received message 3
message:
{string:text="message3"}
received message 4
message:
{string:text="message4"}
received message 5
message:
{string:text="message5"}

Figure 12 – FTL Output from Kafka Send

EMS:
------------------------------------------------------------------------
tibjmsMsgConsumer SAMPLE
------------------------------------------------------------------------
Server....................... tcp://7222
User......................... (null)
Destination.................. ftlqueuein
------------------------------------------------------------------------

Subscribing to destination: ftlqueuein

Received message: MapMessage={ Header={ JMSMessageID={null} JMSDestination={Queue[ftlqueuein]}


JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null}
JMSType={null} JMSTimestamp={Tue Feb 08 10:47:20 CST 2022} JMSDeliveryTime={Tue Feb 08 10:47:20 CST
2022} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1}
JMS_TIBCO_IMPORTED={Boolean:true} JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={
text={String:message1} } }
Received message: MapMessage={ Header={ JMSMessageID={null} JMSDestination={Queue[ftlqueuein]}
JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null}

©2022 TIBCO Software Inc. All Rights Reserved. 19


JMSType={null} JMSTimestamp={Tue Feb 08 10:47:34 CST 2022} JMSDeliveryTime={Tue Feb 08 10:47:34 CST
2022} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1}
JMS_TIBCO_IMPORTED={Boolean:true} JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={
text={String:message2} } }
Received message: MapMessage={ Header={ JMSMessageID={null} JMSDestination={Queue[ftlqueuein]}
JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null}
JMSType={null} JMSTimestamp={Tue Feb 08 10:47:44 CST 2022} JMSDeliveryTime={Tue Feb 08 10:47:44 CST
2022} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1}
JMS_TIBCO_IMPORTED={Boolean:true} JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={
text={String:message3} } }
Received message: MapMessage={ Header={ JMSMessageID={null} JMSDestination={Queue[ftlqueuein]}
JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null}
JMSType={null} JMSTimestamp={Tue Feb 08 10:47:55 CST 2022} JMSDeliveryTime={Tue Feb 08 10:47:55 CST
2022} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1}
JMS_TIBCO_IMPORTED={Boolean:true} JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={
text={String:message4} } }
Received message: MapMessage={ Header={ JMSMessageID={null} JMSDestination={Queue[ftlqueuein]}
JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null}
JMSType={null} JMSTimestamp={Tue Feb 08 10:48:06 CST 2022} JMSDeliveryTime={Tue Feb 08 10:48:06 CST
2022} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1}
JMS_TIBCO_IMPORTED={Boolean:true} JMS_TIBCO_MSG_EXT={Boolean:true} } Fields={
text={String:message5} } }

Figure 13 - EMS output from Kafka Send

©2022 TIBCO Software Inc. All Rights Reserved. 20

You might also like