Automatic JMS client reconnection
Configure your JMS client to reconnect automatically following a network, queue manager, or server failure.
Normally, if a stand-alone IBM MQ classes for JMS application is connected to a queue manager by using the client transport, and the queue manager becomes unavailable for some reason (due to a network outage, a queue manager failure, or the queue manager being stopped, for example), the IBM MQ classes for JMS will throw a JMSException the next time the application tries to communicate with the queue manager. The application must catch the JMSException and attempt to reconnect to the queue manager. We can simplify the design of the application by enabling automatic client reconnection. When the queue manager becomes unavailable, the IBM MQ classes for JMS attempts to reconnect to the queue manager automatically on behalf of the application. This means that the application does not need to contain logic to reconnect.
The use of this implementation of automatic client reconnection is not supported within Java Platform, Enterprise Edition application servers. See Use automatic client reconnection in Java EE environments for an alternative implementation.
- Use automatic JMS client reconnection
If a stand-alone IBM MQ classes for JMS application uses a Connection Factory that has the CONNECTIONNAMELIST or the CCDTURL property set, the application is eligible to use automatic client reconnection. - Reason codes indicating that a queue manager is no longer available
What reason codes indicate that a queue manager is no longer available, or cannot be reached, when attempting automatic IBM MQ classes for JMS reconnection. - Use automatic client reconnection in Java SE and Java EE environments
We can make use of IBM MQ automatic client reconnection to facilitate various high availability (HA) and disaster recovery (DR) solutions within a Java SE and Java EE environment.
Parent topic: Accessing IBM MQ features from an IBM MQ classes for JMS application