TIBCO EMS Routing Step By Step Example

By | November 3, 2015

In enterprise architecture; there can be two or more EMS Servers being used for different application systems which may sometimes require some data communication between each other. To enable transfer of EMS messages between two or more EMS Servers; TIBCO EMS provides routing feature so that messages may be routed from one server to one or more other servers.

In this post; I will be explaining step by step how to achieve routing between two TIBCO EMS Servers.

Step 1: Enable Routing

Enabling the routing feature is the first step that needs to be done. By default; if you look into the configuration file—tibemds.conf; routing is disabled. To enable routing; just change routing value to enabled in this configuration file for both EMS Servers (For ease of understanding I will name the two servers in this post as ServerA and ServerB. In actual; name of the server can be found in the tibemsd.conf file with property name server.)

Make sure that you enable routing in both ServerA and ServerB.

Also note that any changes that you make directly in the configuration files; won’t affect immediately and you will have to restart EMS Servers after making all configuration changes.

Step 2: Create Route

Route from ServerA to ServerB can be created either by defining the route in the configuration file routes.conf on ServerA or by using the below command on EMS administration tool after connecting to EMS ServerA:

create route ROUTE_NAME url=SERVERBURL zone_name=ZONE_NAME zone_type=1hop|mhop properties

in the above command; change ROUTE_NAME to the name of SERVERB, url should be full url of the EMS Server for SERVERB (including protocol, host, port), zone_name can be any name that you want to give to this zone and zone_type should be single hop or multi-hop according to your needs. If routing at only one hop level is needed; use 1hop for this. Properties are optional properties which can be added to the route.

In the same way create route on SERVERB as well where url will be pointing to EMS SERVERA.

Step 3: Create Users on Both Servers for Routing

For routing to work; on both servers we need to create users (either by updating users.conf file or through EMS administration tool).

On SERVERA, create a new EMS User with the same name as the name of SERVERB. This user should have password based on Server Password on SERVERB (set on SERVERB using SET SERVER Password command).

In the same way create a new EMS User on SERVERB with the name matching the name of SERVERA and password same as the server password of SERVERA.

Please note that these user creations are required if authorization is enabled on the server. If the required users are not created or if the users don’t have sufficient rights; you may get error like below:

Unable to initialize route XYZ: route server returned: ‘invalid name or password’

However; If authorization is disabled; this is not needed then.

Step 4: Create Proxy Receiver/Routing Queue and Home Queue

For this example; I am using queues to show how routing works instead of topics. However, routing can be achieved for any types of destinations.

Let’s suppose that we want to route all the messages that are received on a queue tutorialspedia.queue on SERVERA to a queue with the same name on SERVERB.

For this purpose; create a Global queue on SERVERB using below command:

create queue tutorialspedia.queue global

The above command will create a queue tutorialspedia.queue with global property set.

Now, create a queue with the same name on SERVERA but use the suffix @SERVERB for this queue as this will be a routing queue only to route the messages towards the home queue on the SERVERB.

The proxy queue (routing queue) on SERVERA will be created using below command:

create queue tutorialspedia.queue@SERVERB

Step 5: Test EMS routing

After completing step 1 to 4; restart ems servers for both SERVERA and SERVERB so that changes become effective.

After this; just design a simple process in TIBCO BW which will be connecting to SERVERA and send JMS message towards the routing queue.

You should notice that same message is routed to the home queue on SERVERB from where consumers may pick the message and consume it.

Ajmal Abbasi

Ajmal Hussain Abbasi is a TIBCO Consultant By Profession with more than 6 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

6 thoughts on “TIBCO EMS Routing Step By Step Example

  1. Mike P

    Thank you Amjal!
    I found your tips very useful. I think, it’s only one of 100s leaves a thank-you message here, so let me express gratitude for your diligent work from the whole of Tibco users community!
    :)))

    MP

    Reply
  2. Manish

    Thanks, Very useful.
    But if Server routes are already established, we do not need to restart EMS Servers

    Reply
    1. Ajmal Abbasi Post author

      Dear Manish,

      You are right. Restart is required only if routes are created newly. In my tutorial; since routes were created and were not available readily; restart was required. Thanks for your feedback.

      Reply
  3. Durga Prasad

    nice article, crisp and clear. thanks your time to post this.

    Reply
  4. Afroz Baig

    Hi Ajmal,

    Masha Allah, Really your tutorials are very helpful for anybody who is new to TIBCO.

    I am facing a trouble in this route.
    I have two serverA with name SA and ServerB with name SB.
    I am enabling route from ServerA to ServerB.

    For that, i created User SB in Server A.
    and User SA in ServerB.

    Then in ServerA, when i create Route with RouteName as SB, URL of ServerB with Port, Zone Name & Zone Type, the route does not get connected. the Connection says false. Route stays disconnected.
    Then When I deleted this and then in ServerB, when i create Route with RouteName as SA, URL of ServerA with Port, Zone Name & Zone Type, the route gets CONNECTED.

    I know and understand that Route is bi-directional, and if it gets connected from anyside, it should be good. but I want it to be active on ServerA and Passive on ServerB.
    It is happening the reverse way.
    What is the reason? Could you please help me if i am missing anything.
    Thanks in Advance.
    Afroz Baig

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *