Search code examples
javaglassfishjmsjms-topicopenmq

JMS topic subscriber reconnection


I'm using Glassfish 3.1.2.2 with OpemMQ 4.5.2 (remote mode). In my application, there is a subscriber of a JMS topic, that receives messages asynchronously, using a MessageListener.

When broker is stopped and started after a while, messages published to the JMS topic after restart are not received by the subscriber.

What is the best way to recover the topic subscriber?

I've tried ExceptionListener, but apparently it's not supported when running my application on Glassfish.


Solution

  • Changed "Reconnect Attempts" option from "Java Message Service" to "-1" and Glassfish successfully reconnected publisher and subscriber.