What is a route and why we need to use it?

In an Enterprise, the different applications will be using different EMS for data interchange. In some cases, some application might need to send some data to other application which using a different EMS server. To make this possible, Tibco EMS comes with a feature called ROUTE.

How to create a route between the EMS servers?

Consider we have two EMS server named EMSA and EMSB. these are the names which we gave in tibemsd.conf file for the name-server property.

To create a ROUTE between EMSA and EMSB we need to follow the below steps.

  1. Create the users in EMSA and EMSB. Create user EMSA in EMSB server and user EMSB in EMSA server with the corresponding EMS server password.
    Syntax: create user <name> [<description>] [password=<password>]
    
    create user EMSB "Route to EMSA" password="p@ssw0rd" //password is the same which we used to login to EMSB serve
    
    create user EMSA "Route to EMSB" password="pa$$word" //password is the same which we used to login to EMSA server
  2. Add users to the admin group. The users should have admin privileges. So we need to add the users to the admin group.
    Syntax: add member <group-name> <user-name>[,<user-name2>,...]
    
    add member $admin EMSA   //Run in EMSB server
    
    add member $admin EMSB   //Run in EMSA server
  3.  Create a global destination in both EMS servers. We need to create a global queue/topic in both EMS with the same name.
    Syntax :   create topic <name> [<properties>]
    
    create topic ROUTE.COMMON.TOPIC secure,global  //Run this command in both EMSA and EMSB server
  4. Create the route to the EMS server. The route is bi-directional. So we can run the below command in one of the EMS server.
    Syntax:create route  <name> url=<url> [zone_name=<zone-name>] [zone_type=<zone-type>] 
    
    create route EMSB url=tcp://EMSA:7000 zone_name=Z1 zone_type=1hop

This will create a route between the EMS server. if all configuration is correct you will be able to see a connection id else it will be showing a ‘-‘ symbol under ConnID column.

Note: If every configuration is correct and still it not working, then Confirm that you have the encrypted password added to the tibemsd.conf file in both EMS server. Please see below.

Route password
tcp://EMSA:7020> show routes
Route    T    ConnID  URL              ZoneName    ZoneType
EMSB     A        46  tcp://EMSB:7000     Z1          1
tcp://EMSB:7020> show routes
Route    T    ConnID  URL              ZoneName    ZoneType
EMSA     P        51  tcp://EMSA:7000     Z1          1

Now you can create routed queue or durables between these EMS servers and data will be passing through.

Read my post to know about the durable & routed queue.

Please comment if you have any queries on this.

Leave a Reply

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