JMS Broker Reconnect Issue.



I need to introduce a JMS reconnect feature into an existing application.
Basically, the application is a simple consumer of messages from a JMS
topic. My requirement is to have the application continue to consume
messages after the connected JMS service is restarted. I detect the failed
JMS service through the ExceptionListener callback. Once detected, I go into
a reconnect loop.

The reconnect loop attempts to make the JMS connections once every minute
until the JMS service is again available. Obviously, it will fail if the
service has not come back yet. That's not the problem. The problem is:

1. The JNDI lookups continually fail after the service is back. Note: I am
using a Sun One Appserver 7 with both the JNDI and JMS all in one. When I
say "service is back", I mean both the JNDI and the JMS service are up and
running.

2. I do something like this:

context = new InitialContext();
factory = (TopicConnectionFactory) context.lookup("abc");

This works when the application first comes up, but fails when trying it
after the Appserver (JNDI/JMS) is restarted. Is there something lingering
that prevents these calls from working?

My question is: What is required to get this to work? Is this approach an
acceptable recovery solution? Thanks in advance for any help.

Steve


.



Relevant Pages

  • Re: OpenJMS and communication to non-JMS
    ... but I probably don't want to run tomcat either. ... JMS, but is not primarily a JMS service, if you get my meaning. ... I'm sure there are messaging servers that support JMS as well as have C/C++ libraries. ...
    (comp.lang.java.programmer)
  • Re: How-to send a non-persistent (BUFFERED) message using JMS?
    ... I think i figure out the problem with the multi consumer. ... would expect the Oracle implementation of JMS to map the JMS ... Daniel A. Morgan ... Puget Sound Oracle Users Group ...
    (comp.databases.oracle.misc)
  • Re: How-to send a non-persistent (BUFFERED) message using JMS?
    ... DA Morgan wrote: ... I think i figure out the problem with the multi consumer. ... would expect the Oracle implementation of JMS to map the JMS ... Puget Sound Oracle Users Group ...
    (comp.databases.oracle.misc)