Taking a Test Drive
To verify that your TIBCO Messaging - Bridge for Apache Kafka installation is ready for configuration and deployment, perform the following general tasks and confirmations. This information targets simple default configurations and uses examples; your requirements may vary and should be reflected in your resultant configuration settings.
This section assumes operation in a Linux or macOS environment, with the FTL Server used as a message broker.
Environment Variables
For simplified operation, set the following environment variables.
Example:
export FTL_HOME=/opt/tibco/ftl/6.4
export KAFKA_HOME=/opt/tibco/akd/core/2.5
export AKD_BRIDGE_HOME=/opt/tibco/akd/bridge/2.3
Paths
Add the following directories to your programs search path. These examples use typical paths for default software installations and may need to be modified to reflect the specific installation directories for software on your system.
Example:
export PATH=$FTL_HOME/bin:$PATH export PATH=$FTL_HOME/samples/bin:$PATH export PATH=$FTL_HOME/samples/bin/advanced:$PATH export PATH=$FTL_HOME/samples/scripts:$PATH export PATH=$KAFKA_HOME/bin:$PATH
Start Servers and Bridge Connectors
Start the FTL and Kafka servers first, and then the bridge connectors. You need administrative permissions to run these commands.
-
Start the FTL server:
cd $FTL_HOME/samples/samples . ./setup cd $FTL_HOME/samples/scripts ./ftlstart ftls1@localhost:8585
You see:FTL Server configuration file has been saved as /var/tmp/<userID>_ftlstart_ftl_xxx.yaml
Note: To stop the FTL server, enterftlstop ftls1@localhost:8585
-
Load the sample TIBCO FTL realm, which includes configuration information for the FTL side of the TIBCO Bridge for Apache Kafka:
$FTL_HOME/bin/tibftladmin -rs http://localhost:8585 -ur \ $AKD_BRIDGE_HOME/config/sample-realm.json
You see:************************************************************ TIBCO FTL Realm Service Version 6.4.0 V4 Copyright 2009-2020 Cloud Software Group, Inc. All Rights Reserved. Confidential & Proprietary. Executing updaterealm on server at http://localhost:8585 ************************************************************ Started deployment named 2020-05-07-20-56-54-GMT and status is Starting - notifying clients and servers The status of this deployment can be checked with the --status flag.
-
Start Apache ZooKeeper, Kafka-Broker, and Bridge for Apache Kafka.
$AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --start
To view status:
$AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --status
Script help:
$AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --help
Using the Bridge
Using two other command line windows (an FTL window and a Kafka window):
-
In the FTL window, start a TIBCO FTL receiving application:
$FTL_HOME/samples/bin/advanced/tibrecvex -a ftl-subscriber \ -e kafka-connect-sink-sendendpoint -c 1 http://localhost:8585
-
In the Kafka window, send a message from your Kafka system using kafka-client.
echo '{"My-Long":12345,"My-String":"Hello","My-Opaque":{"_o_":"b3BhcXVl"}}' | \ $KAFKA_HOME/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic ftl-messages -
In the FTL window, verify that the received message is similar to this:
# # tibrecvex # # TIBCO FTL Version 6.4.0 V4 # Invoked as: tibrecvex -a tibrecvex -e kafka-sink-endpoint -c 1 http://thai.na.tibco.com:31500 waiting for message(s) received message 1 message: type long: 12345 type string: 'Hello' type opaque: size 6 data: 'opaque'
-
In the Kafka window, start a Kafka consumer:
$KAFKA_HOME/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 \ --max-messages 10 --topic ftl-messages
-
In the FTL window, send a message from FTL:
$FTL_HOME/samples/bin/advanced/tibsendex -a ftl-publisher \ -e kafka-connect-source-recvendpoint -c 10 http://localhost:8585
-
In the Kafka window, verify that the message is received. For example:
----- got message ----- {"My-Long":1,"My-String":"kafka-source-endpoint","My-Opaque":{"_o_":"b3BhcXVl"}} ----- got message ----- {"My-Long":2,"My-String":"kafka-source-endpoint","My-Opaque":{"_o_":"b3BhcXVl"}} ...etc.
