Taking a Test Drive
To verify that your TIBCO Messaging - Bridge for Apache Pulsar 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.
This section assumes operation in a Linux or macOS environment, with the FTL Server used as a message broker.
Bridge for Apache Pulsar Installation
See the TIBCO Messaging - Bridge for Apache Pulsar Installation manual.
Environment Variables
For simplified operation, set the following environment variables.
Example:
export FTL_HOME=/opt/tibco/ftl/6.4 export APD_HOME=/opt/tibco/apd/core/2.5 export APD_BRIDGE_HOME=/opt/tibco/apd/bridge/1.0 export PULSAR_LOG_DIR=/tmp/pulsar
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=$APD_HOME/bin:$PATH
Start Servers and Bridge Connectors
Start the FTL and Pulsar servers first, and then the bridge connectors. You need administrative permissions to run these commands.
-
Start the FTL server:
cd $FTL_HOME/samples . ./setup $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$FTL_HOME/samples/scripts/ftlstop ftls1@localhost:8585
-
Load the sample TIBCO FTL realm, which includes configuration information for the FTL side of the TIBCO Bridge for Apache Pulsar:
$FTL_HOME/bin/tibftladmin -rs http://localhost:8585 -ur \ $APD_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 Pulsar. Ensure that all directories are writable.
$APD_HOME/bin/pulsar standalone --zookeeper-dir \ /tmp/pulsar --bookkeeper-dir /tmp/pulsar
Note: To stop pulsar standalone, enter Ctrl-C. -
After Apache Pulsar has started, in a new command line, load the Apache Pulsar Source Connector using the provided sample configuration file. This step configures the bridge to receive messages from FTL applications and republish them on the topic specified using the --destination-topic-name (ftl-messages in this case).
$APD_HOME/bin/pulsar-admin sources create --tenant public \ --namespace default --name ftl-source --source-type ftl \ --destination-topic-name ftl-messages --source-config-file \ $APD_BRIDGE_HOME/config/ftl-source.yaml
You see:"Created successfully"
-
Load the Apache Pulsar Sink Connector using the provided sample configuration file. This command line configures the Sink Connector to subscribe to the Pulsar topic to-ftl (using the --input option) subscribes to Pulsar topic to-ftl and forwards messages received on this topic to FTL.
$APD_HOME/bin/pulsar-admin sinks create --tenant public \ --subs-position Earliest --namespace default --name ftl-sink \ --sink-type ftl --inputs ftl-messages --sink-config-file \ $APD_BRIDGE_HOME/config/ftl-sink.yaml
You see:"Created successfully"
Using the Bridge
Using two other command line windows:
-
In window #1, start a TIBCO FTL receiving application:
$FTL_HOME/samples/bin/advanced/tibrecvex -a tibrecvex \ -e pulsar-sink-endpoint -c 2 http://localhost:8585
-
In window #2, send a message from your Pulsar system using pulsar-client.
echo '{"My-Long":12345,"My-String":"Hello","My-Opaque":{"_o_":"b3BhcXVl"}}' | \ $APD_HOME/bin/pulsar-client produce -f /dev/stdin ftl-messages -n 2
-
In window #1, verify that the received message is similar to this:
# # tibrecvex # # TIBCO FTL Version 6.4.0 V4 # Invoked as: tibrecvex -a tibrecvex -e pulsar-sink-endpoint -c 2 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' received message 2 message: type long: 12345 type string: 'Hello' type opaque: size 6 data: 'opaque'
-
In window #2, start a Pulsar consumer:
$APD_HOME/bin/pulsar-client consume -s ftl-source ftl-messages -n 2
-
In window #1, send a message from FTL:
$FTL_HOME/samples/bin/advanced/tibsendex -a tibsendex \ -e pulsar-source-endpoint -c 2 http://localhost:8585
-
In window #2, verify that the message is received. For example:
----- got message ----- {"My-Long":1,"My-String":"pulsar-source-endpoint","My-Opaque":{"_o_":"b3BhcXVl"}} ----- got message ----- {"My-Long":2,"My-String":"pulsar-source-endpoint","My-Opaque":{"_o_":"b3BhcXVl"}}
Deleting the Connectors
To delete the source connector:
$APD_HOME/bin/pulsar-admin sources delete --name "ftl-source"
You see:
"Delete source successfully"
To delete the sink connector:
$APD_HOME/bin/pulsar-admin sink delete --name "ftl-sink"
You see:
"Deleted successfully"