Jump to content
We have recently updated our Privacy Statement, available here ×
  • BW5.X - How to make sure TIBCO BusinessWorks 5.X can connect or reconnect to an EMS server in every cases

    The TIBCO BusinessWorks platform is made of multiple components that are often distributed over multiple servers or Virtual Machines.

    One important component of the platform is the TIBCO EMS Messaging server and it is key for the BusinessWorks engines to be able to manage cases where the EMS server might be unavailable or unreachable for some time.

    BusinessWorks has a build-in mechanism to reconnect to the EMS server if needed, but it is still a good practice to leverage EMS client library reconnection mechanisms and the case of the initial connection is still to be managed.

    With the configuration best practices from this article BusinessWorks should be able to connect or reconnect to EMS in every cases.

    EMS Configuration

    Before configuring BusinessWorks we should include in the EMS set-up the parameters that will allow the EMS server and EMS client libraries to detect quickly that connection has been lost.

    For this the following parameters have to added in the tibemsd.conf file :

    client_heartbeat_server = 20

    server_timeout_client_connection = 90

    server_heartbeat_client = 20

    client_timeout_server_connection = 90

    server_heartbeat_server = 20

    server_timeout_server_connection = 90

    Once the tibemsd.conf file is updated the EMS server should be restarted for the parameters to be taken into account.

    BusinessWorks configuration

    On all BusinessWorks servers of the configuration edit the ‘bwengine.tra’ file and add the following properties at the end of the file :


    java.property.com.tibco.tibjms.connect.attempts 6, 10000

    java.property.com.tibco.tibjms.reconnect.attempts 12, 10000

    The first property is a BusinessWorks property that tell the engine to try to reconnect to the EMS, for an undefined amount of time, if it is not available when the engine is started (without this property the process starter is not activated and will remain unactive until the BusinessWorks engine is restarted).

    The two other properties are managed by the EMS client library. The first parameter defines a number of retries, the second parameter the delay between retries (in milliseconds). These parameters are used by EMS connections of type ‘Direct Connection’ and also for the connection to the EMS server acting as a JNDI server in the case of connections using ‘Connection Factories’.

    Once the bwengine.tra files are updated on all servers, BusinessWorks applications have to be redeployed for the parameters to be taken into account.

    Connection factories configuration

    By default BusinessWorks projects are using the default EMS ‘QueueConnectionFactory’ and ‘TopicConnectionFactory’.

    The connection and reconnection parameters of these factories can be set with the following tibemsadmin command:

    addprop factory QueueConnectionFactory url=tcp://server1:7222,tcp:// server2:7222

    addprop factory QueueConnectionFactory connect_attempt_count=6

    addprop factory QueueConnectionFactory connect_attempt_delay=10000

    addprop factory QueueConnectionFactory connect_attempt_timeout=1000

    addprop factory QueueConnectionFactory reconnect_attempt_count=12

    addprop factory QueueConnectionFactory reconnect_attempt_delay=10000

    addprop factory QueueConnectionFactory reconnect_attempt_timeout=1000

    addprop factory TopicConnectionFactory url=tcp://server1:7222,tcp:// server2:7222

    addprop factory TopicConnectionFactory connect_attempt_count=6

    addprop factory TopicConnectionFactory connect_attempt_delay=10000

    addprop factory TopicConnectionFactory connect_attempt_timeout=1000

    addprop factory TopicConnectionFactory reconnect_attempt_count=12

    addprop factory TopicConnectionFactory reconnect_attempt_delay=10000

    addprop factory TopicConnectionFactory reconnect_attempt_timeout=1000

    Note that if other factories than the default ones are used in your BusinessWorks projects they should also be configured like above. Note also that even if you are using only one standalone EMS server the URL should be in the ‘FT’ format (for example : tcp://myserver:7222,tcp://myserver:7222).

    With the ‘bw.plugin.jms.recoverOnStartupError’ property set and the EMS client library and connection factories configured for reconnection your BusinessWorks platform should now be able to connect and reconnect to the EMS server in every cases which will make it very reliable.

    Reference KB article :


    Additional elements useful for Java applications

    Java applications using the JMS API that do not manage their own reconnection mechanism can use the EMS client library properties mentioned above with the following approach.

    On java command line used to start the application add the following parameters (with -D java command line option), for example :

    java -Dcom.tibco.tibjms.connect.attempts 5000,10000 -Dcom.tibco.tibjms.reconnect.attempts 5000,10000

    In the example above :

    . 5000 is the number of retries

    . 10000 is delay between retries (in milli seconds)

    With the above the application can survive an EMS downtime of 50 000 seconds (14 hours approximately) even is the application doesn’t implement any re connection mechanisms in its own logic.

    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...