TIBCO Adapters – Received read Advisory Error (JMS Related)

While testing for failover we found that the adapter is not failing over properly to the secondary ems server in case if the primary is down. The adapter logs show the below error. The adapter does not pick up any messages when this error occurs.

Advisory: _SDK.ERROR.JMS.RECEIVE_FAILED : { {ADV_MSG, M_STRING, “Consumer receive failed. JMS Error: Illegal state, SessionName: TIBCOCOMJmsTerminatorSession, Destination: Rep.adcom.Rep-COMAdapter_Rep_v1.exit” } {^description^, M_STRING, “” } }.

The only way to resolve this is to restart the adapter so that it reconnects to the ems server. Then it picks up the messages.


“JMS Error: Illegal state” usually happens when a JMS call or request occurs in an inappropriate context. For example, a consumer is trying to receive message while the JMS server is down.  In your case you are saying that this is happening during EMS failover from machine1 to machine2.

One thing to keep in mind is that depending on the number of oustanding messages, connections, and other resources managed by EMS there may be a brief period before the secondary server is ready to accept connections.

Clients that disconnect will typically attempt to reconnect, however there is a limit to the number of reconnection attempts (as well as the interval between attempts).   These are specified at the connection factory level in factories.conf.  Here are some of the applicable settings:


reconnect_attempt_count – After losing its server connection, a client program configured with more than one server URL attempts to reconnect, iterating through its URL list until it re-establishes a connection with an EMS server. This property determines the maximum number of iterations. When absent, the default is 4.

reconnect_attempt_delay – When attempting to reconnect, the client sleeps for this interval (in milliseconds) between iterations through its URL list. When absent, the default is 500 milliseconds.

reconnect_attempt_timeout – When attempting to reconnect to the EMS server, you can set this connection timeout period to abort the connection attempt after a specified period of time (in milliseconds).

It may also be helpful to specify heartbeats between the adapter and the EMS server.  This way if the EMS server is brought down either gracefully or ungracefully the connection will be reset when the configured number of heartbeats is missed.  This should then trigger the reconnection attempts described above.  The heartbeat settings are defined in the tibemsd.conf.  Here are some relevant settings:

client_heartbeat_server – Specifies the interval clients are to send heartbeats to the server.

server_timeout_client_connection – Specifies the period of time server will wait for a client heartbeat before terminating the client connection.

server_heartbeat_client – Specifies the interval this server is to send heartbeats to all of its clients.

client_timeout_server_connection – Specifies the period of time a client will wait for a heartbeat from the server before terminating the connection.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s