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. These tasks and associated examples target simple default configurations. Your requirements may vary and should be reflected in your configuration settings.

This section assumes operation in a Linux or macOS environment, with the FTL Server used as a message broker.

Prerequisites

  • TIBCO FTL, version 6.4 or later

Bridge for Apache Kafka Installation

See the Bridge for Apache Kafka Installation manual.

Environment Variables

For simplified operation, set the following environment variables.

  • FTL_HOME –– the base FTL installation directory
  • KAFKA_HOME –– the base Kafka installation directory, which must have write permissions
  • AKD_BRIDGE_HOME –– the Bridge for Apache Kafka installation directory

Example:

export FTL_HOME=/opt/tibco/ftl/current-version
export KAFKA_HOME=/opt/tibco/akd/core
export AKD_BRIDGE_HOME=/opt/tibco/akd/bridge
Note: You must set these environment variables for every new console window opened.

Paths

Add the following directories to your search path. These examples use typical paths for default software installations. If needed, modify them 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.

  1. Start the FTL server:

    cd $FTL_HOME/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, enter:

ftlstop ftls1@localhost:8585
  1. 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 TIBCO Software 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.
  1. Move the $AKD_BRIDGE_HOME/lib/*.jar to $KAFKA_HOME/libs/.

  2. Start Apache ZooKeeper, Kafka Broker, and Bridge for Apache Kafka.

python3 $AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --start
  1. To view status:

python3 $AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --status
  1. To get script help:

python3 $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):

  1. 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
  2. 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
    
  3. 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'
  4. 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
  5. 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
  6. 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.

Stopping the Service

To stop Apache ZooKeeper, Kafka Broker, and Bridge for Apache Kafka:

python3 $AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --stop

To view status:

python3 $AKD_BRIDGE_HOME/scripts/kafka_ftl_bridge.py --status

Log Files

The Bridge for Apache Kafka scripts create log files in the following directories:

  • The kafka-logs directory as configured within your Apache Kafka instance
  • /tmp/zookeeper
  • /var/tmp/<UserName>