Jump to content
  • How to use TIBCO eFTL? with TIBCO Enterprise Message Service?


    Bill Mclane

    TIBCO eFTL can be set to communicate with either an TIBCO FTL network or an TIBCO EMS Server. In this example we look at how to configure TIBCO eFTL with TIBCO EMS with the ability to both publish and subscribe to EMS traffic.

    Steps listed below illustrate how TIBCO eFTL publish/subscribe can be configured and managed using EMS. 

    Configure and start the servers

    Start the TIBCO EMS server 

     SP:bin sp$ ./tibemsd64.sh  TIBCO Enterprise Message Service. Copyright 2003-2016 by TIBCO Software Inc. All rights reserved.  Version 8.3.0 V14 3/9/2016  2017-11-10 21:07:09.068 Process started from '/home/sp/tibcobw/ems/8.3/bin/tibemsd64'. 2017-11-10 21:07:09.068 Process Id: 28072 2017-11-10 21:07:09.068 Hostname: SP.local 2017-11-10 21:07:09.068 Hostname IP address: 192.168.1.156 2017-11-10 21:07:09.068 Hostname IP address: 192.168.1.156 2017-11-10 21:07:09.068 Reading configuration from '/home/sp/TIBCO_HOME/tibco/cfgmgmt/ems/data/tibemsd.conf'. 2017-11-10 21:07:09.072 Logging into file '/home/sp/TIBCO_HOME/tibco/cfgmgmt/ems/data/datastore/logfile' 2017-11-10 21:07:09.072 Server name: 'EMS-SERVER'. 2017-11-10 21:07:09.072 Storage Location: '/home/sp/TIBCO_HOME/tibco/cfgmgmt/ems/data/datastore'. 2017-11-10 21:07:09.072 Routing is disabled. 2017-11-10 21:07:09.072 Authorization is disabled. 2017-11-10 21:07:09.079 Accepting connections on tcp://SP.local:7222. 2017-11-10 21:07:09.079 Recovering state, please wait. 2017-11-10 21:07:09.097 Recovered 366 messages. 2017-11-10 21:07:09.097 Server is active. 

    Start the TIBCO FTL Realm Server 

     SP:bin sp$ ./tibrealmserver -ht *:8080 2017-11-10 21:11:27.968 info  ftl: TIBCO FTL Version 5.3.0 V8 Copyright 2009-2017 TIBCO Software Inc. All Rights Reserved. Confidential & Proprietary.  2017-11-10 21:11:27.968 info  ftl: Opening database at /home/sp/tibcobw/eftl/3.3/ftl/bin/rs_data.db 2017-11-10 21:11:28.564 info  ftl: FTL component starting at tcp://*:8083 2017-11-10 21:11:28.568 info srvs: starting primary realmserver 2017-11-10 21:11:28.568 info srvs: Server is now running. 2017-11-10 21:11:28.568 info srvs: Realm UUID    0798d39a-8c70-451c-b8ea-2e7d3ce86570 2017-11-10 21:11:28.568 info srvs: Server UUID   7e695307-c398-4670-9869-7adfa883141c 2017-11-10 21:11:28.568 info  web: starting HTTP server at http://*:8080 2017-11-10 21:11:29.569 info grps: Group Service starting. Connecting to realmserver primary:'http://SP.local:8080', secondary:'' as Primary 2017-11-10 21:11:32.603 info grps: Setting Group Service State to RUNNING 2017-11-10 21:11:32.603 info grps: Group Service started successfully. 

    Configure the TIBCO eFTL server using the the TIBCO FTL realm configuration UI

    screen_shot_2017-11-09_at_00_00_25.thumb.png.daa83ae0de02cd9637410487fe819a9b.png

    Connect to the Realm Server and login using the appropriate credentials.  You can reach the Realm Server on the host where it was started at port 8080 - for example, "http://localhost:8080".

    Once connected, you will see the login page.  If you have setup credentials, you would need to enter them here.  If you are running an "out-of-the-box" configuration, you can login using the user name "anyone".

    • Enable Edit mode to start editing the Realm configuration by clicking on the "Edit" switch on the top bar of the user interface.
    • Click on the eFTL Clusters configuration link on the main menu at the left hand side of the page
    • Add a new eFTL Clusters configuration by clicking on the ?+? sign at the top of the grid; this will add a new line to the grid where will will enter the information about the new eFTL server cluster we will be creating for this example.
    • Enter the following configuration paramters for the eFTL cluster we just added:
      •     eFTL Cluster : Cluster  (this needs to match -n <clustername> in the eftl server startup)
      •     Channel Name: channel  (this is the ?file? part in the eFTL URL at the client)
      •     Messaging: EMS  (Options are EMS or FTL, since this cluster will be connecting to an EMS backend, we will choose EMS for this example)
      •     EMS Server: tcp://7222,tcp://7222  (these point to the EMS server)
      •     EMS Delivery Mode: Persistent  (Both Persistent or Non-Persistent options are available; for this example we are enabling persistence)
      •     EMS Topic Prefix: eFTL  (Optional - this ensures that eFTL related topics would be automatically prefixed with this string for both publishing and subscribing. e.g with the prefix set to eFTL, the eFTL related topic names in EMS would need to start with ?eFTL.? and the prefix will automatically added to the field or matcher _dest)

    Once you have made the above changes, you will need to deploy the changes at the TIBCO FTL Realm Server in order for them to be available to the TIBCO eFTL server when it starts.

    To do this, click on the "Deploy" area in the top bar of the Realm Server UI (just to the right of the "Edit" control).  You will be asked to enter a deployment name (the default is fine unless you want to name it something more descriptive like "eFTL to EMS Deployment"); you can leave the Description field blank for now or enter an optional description if you like).  Click the "Deploy" button in the dialog box and click through the deployment progress window as needed.

    Once the deployment has completed, you're ready to continue.

    Start the TIBCO eFTL Server 

     SP:bin sp$ ./tibeftlserver -n Cluster -rs http://`hostname`:8080 -l *:9191 TIBCO eFTL Server 3.3.0   V8 Copyright 2013-2017 TIBCO Software Inc. All Rights Reserved. Confidential & Proprietary.  2017-11-10 21:25:53.084 warn brkr: Client authentication is disabled 2017-11-10 21:25:53.187 info brkr: Creating listener at ws://*:9191 2017-11-10 21:25:53.187 info brkr: Listening for connections on [::]:9191 2017-11-10 21:25:53.187 info brkr: Listening for connections on 0.0.0.0:9191 2017-11-10 21:25:53.190 info brkr: Channel channel started 2017-11-10 21:25:53.190 info brkr: eFTL server started

    The TIBCO eFTL Server will contact the TIBCO FTL Realm Server and obtain all of the appropriate configuration that we just entered in the previous section.

    Connecting the components

    Now it's time for just a few more steps to complete the connectivity to get messages flowing between eFTL and EMS.

    Configure TIBCO EMS for TIBCO eFTL Messaging

    Create a topic and a durable:

     tcp://localhost:7222> create topic eFTL.topic.test1 trace=body Topic 'eFTL.topic.test1' has been created 

    We created a topic with trace=body set, so that we could see the actual messages in the TIBCO EMS server logs.  This is ok for a test or example setup like what we are doing here but you probably would not want to do that for an actual production configuration; it is very handy for now though!

     tcp://localhost:7222> create durable eFTL.topic.test1 eFTL-sub.test.dur Durable 'eFTL-sub.test.dur' has been created

    TIBCO eFTL prefixes its durable names with its client name, so we create a durable on the topic of the form <clientid>.<durable>, where clientid=eFTL-sub, and durable=test.dur

    At this point, we have the configuration in place so the messages would flow as expected.  Now it's time to move on to the actual applications that will be doign the publishing and subscribing so we would have some data to move.

    Prepare and start the publisher program 

    screen_shot_2017-11-09_at_07_40_19.thumb.png.56396df93a239987760585e5e374b2dc.png

    We will use the TIBCO eFTL JavaScript samples for this example so we'll start by copying the TIBCO eFTL JavaScript library to a local directory and editing the publisher.html file as shown above

     SP:bin sp$ cd /home/su/tibcobw/eftl/3.3/samples/javascript SP:javascript sp$ cd ../../sdks/javascript/lib/eftl.js . 

    Open <eftl_home>/samples/javascript/publisher.html in a web browser and ensure the URL is correct.

    screen_shot_2017-11-10_at_22_04.43_0.thumb.png.582a6d493b66caf7db872fca045f37eb.png

    If everything looks OK, click on connect you should see messages being published eery second.

    screen_shot_2017-11-10_at_22_08_47.thumb.png.815fe4635df1a0ddd003c3c573d20e77.png

    Let's check to make sure the messages are being seen in TIBCO EMS as well; we'll do that by seeing if the expected topics are visible and verifying message counts in the "Msgs" column:

     tcp://localhost:7222> show topics                                                                All Msgs            Persistent Msgs    Topic Name                        SNFGEIBCTM  Subs  Durs     Msgs    Size        Msgs    Size      eFTL.topic.test1                  --------+-     1     1       10     1.9 Kb       10     1.9 Kb   sample                            ----------     0     0        0     0.0 Kb        0     0.0 Kb   topic.sample                      ----------     1     0        0     0.0 Kb        0     0.0 Kb   topic.sample.exported             ----+-----     0     0        0     0.0 Kb        0     0.0 Kb   topic.sample.imported             -----+----     0     0        0     0.0 Kb        0     0.0 Kb 

    Due to the trace=body directive we specified earlier, we'll also be able to see the messages in the TIBCO EMS Server log - take a look there and you should see output similar to that below.  You'll be able to key in on the "topic='eFTL.topic.test1'" strings in the log to verify the the messages are flowing from the publisher to the TIBCO EMS Server. Also notice that all of the messages show up as "received from...", this is because we have not yet started the subscriber so the messages are pending at the server.

     2017-11-13 15:10:49.035 [MSG:60157] received from user='anonymous': connID=8 prodID=2 msgID='ID:EMS-SERVER.D9CD5A099CF87:1' Time=1510585849033  mode=PERSISTENT size=169 topic='eFTL.topic.test1' msg=MapMessage={Header={ JMSDestination={TOPIC:'eFTL.topic.test1'} JMSDeliveryMode={PERSISTENT} JMSPriority={4} JMSMessageID={ID:EMS-SERVER.D9CD5A099CF87:1} JMSTimestamp={1510585849033} JMSDeliveryTime={1510585849033}} Body={"text"={string:'This is a sample eFTL message'}} "number"={long:1}}} 2017-11-13 15:10:50.034 [MSG:60158] received from user='anonymous': connID=8 prodID=3 msgID='ID:EMS-SERVER.D9CD5A099CF87:2' Time=1510585850034  mode=PERSISTENT size=169 topic='eFTL.topic.test1' msg=MapMessage={Header={ JMSDestination={TOPIC:'eFTL.topic.test1'} JMSDeliveryMode={PERSISTENT} JMSPriority={4} JMSMessageID={ID:EMS-SERVER.D9CD5A099CF87:2} JMSTimestamp={1510585850034} JMSDeliveryTime={1510585850034}} Body={"text"={string:'This is a sample eFTL message'}} "number"={long:2}}} 2017-11-13 15:10:51.034 [MSG:60159] received from user='anonymous': connID=8 prodID=2 msgID='ID:EMS-SERVER.D9CD5A099CF87:3' Time=1510585851034  mode=PERSISTENT size=169 topic='eFTL.topic.test1' msg=MapMessage={Header={ JMSDestination={TOPIC:'eFTL.topic.test1'} JMSDeliveryMode={PERSISTENT} JMSPriority={4} JMSMessageID={ID:EMS-SERVER.D9CD5A099CF87:3} JMSTimestamp={1510585851034} JMSDeliveryTime={1510585851034}} Body={"text"={string:'This is a sample eFTL message'}} "number"={long:3}}} 2017-11-13 15:10:52.035 [MSG:60160] received from user='anonymous': connID=8 prodID=4 msgID='ID:EMS-SERVER.D9CD5A099CF87:4' Time=1510585852035  mode=PERSISTENT size=169 topic='eFTL.topic.test1' msg=MapMessage={Header={ JMSDestination={TOPIC:'eFTL.topic.test1'} JMSDeliveryMode={PERSISTENT} JMSPriority={4} JMSMessageID={ID:EMS-SERVER.D9CD5A099CF87:4} JMSTimestamp={1510585852035} JMSDeliveryTime={1510585852035}} Body={"text"={string:'This is a sample eFTL message'}} "number"={long:4}}} 2017-11-13 15:10:53.035 [MSG:60161] received from user='anonymous': connID=8 prodID=3 msgID='ID:EMS-SERVER.D9CD5A099CF87:5' Time=1510585853035  mode=PERSISTENT size=169 topic='eFTL.topic.test1' msg=MapMessage={Header={ JMSDestination={TOPIC:'eFTL.topic.test1'} JMSDeliveryMode={PERSISTENT} JMSPriority={4} JMSMessageID={ID:EMS-SERVER.D9CD5A099CF87:5} JMSTimestamp={1510585853035} JMSDeliveryTime={1510585853035}} Body={"text"={string:'This is a sample eFTL message'}} "number"={long:5}}}

    At this point, we're generating messages and have seen that they are being received by the TIBCO EMS Server.  The next step is to create a subscriber to actually receive those messages to get our "end-to-end" connectivity in place.

    Prepare and run the subscriber

    Before we start the subscriber, we'll add a few configuration items 

    screen_shot_2017-11-09_at_07_58_41.thumb.png.5a20cee91335c8070cf316614f37d43a.png

    Set the matcher in the subscriber to ?{?_dest?:?topic.test?}?.  It is important to note that since we set the topic prefix to ?eFTL? this matcher will actually subscribe to topic ?eFTL.topic.test1?.

    Set the durable to ?test.dur? and clientID to "eFTL-sub" to match the durable we created on the TIBCO EMS side.

    screen_shot_2017-11-09_at_08_55_11.thumb.png.9f82406eefd4dc2dbd94bc4852fdd5d9.png

    Start the Subscriber

    Open <eftl_home>/samples/javascript/subscriber.html in a web browser and ensure the URL is correct 

    Start the subscriber by clicking on "Connect"; you should now see the messages received by the application.  Because we're using persistence, you'll get all of the messages starting with the first one which was sent long before we even started the subscriber - persistence in action.

    screen_shot_2017-11-13_at_15_31_46.thumb.png.3fdf0b6bf4ba3a83fe7e98b6efc299bd.png

    We can check to make sure that the messages on the TIBCO EMS side are being been consumed by seeing the "Msgs" count decreasing:

     tcp://localhost:7222> show topics                                                                All Msgs            Persistent Msgs    Topic Name                        SNFGEIBCTM  Subs  Durs     Msgs    Size        Msgs    Size      eFTL.topic.test1                  --------+-     1     1       10     1.6 Kb       10     1.6 Kb   sample                            ----------     0     0        0     0.0 Kb        0     0.0 Kb   topic.sample                      ----------     0     0        0     0.0 Kb        0     0.0 Kb   topic.sample.exported             ----+-----     0     0        0     0.0 Kb        0     0.0 Kb   topic.sample.imported             -----+----     0     0        0     0.0 Kb        0     0.0 Kb tcp://localhost:7222> show durables   Topic Name        Durable             Shared  User         Msgs    Size      eFTL.topic.test1  eFTL-sub.test.dur   N       <offline>      10     1.6 Kb tcp://localhost:7222> show durables   Topic Name        Durable             Shared  User         Msgs    Size      eFTL.topic.test1  eFTL-sub.test.dur   N       anonymous       0     0.0 Kb 

    At this point, we also see the messages being sent out to the receiver and subsequently acknowledged by the receiver in the server logs as a result of the trace=body property being set on the destination.

     2017-11-13 15:31:42.153 [MSG:60169] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:11' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60170] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:12' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60171] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:13' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60172] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:14' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60173] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:15' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60174] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:16' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60175] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:17' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60176] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:18' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60177] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:19' topic='eFTL.topic.test1' 2017-11-13 15:31:42.153 [MSG:60178] sent to user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:20' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60169] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:11' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60170] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:12' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60171] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:13' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60172] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:14' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60173] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:15' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60174] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:16' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60175] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:17' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60176] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:18' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60177] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:19' topic='eFTL.topic.test1' 2017-11-13 15:31:42.295 [MSG:60178] acknowledged by user='anonymous': connID=8 consID=12 msgID='ID:EMS-SERVER.D9CD5A099CF87:20' topic='eFTL.topic.test1' 

    There you have it.  While this is a fairly simple example, it touches on all of the key areas to get TIBCO eFTL and TIBCO EMS communicating.

    publisher.html

    subscriber.html


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...