• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS Client and server restart?  RSS feed

 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi forum:
I'm looking for a best-of practice here. If I have a very simple remote (not inside the j2ee server) jms client waiting for publications to a queue or topic, the client just sits there waiting. If the j2ee server is restarted, the client still just sits there. How can the client determine that the j2ee server has been restarted so it can re-connect itself?
Thanks,
Mike
 
Vinod John
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to check whether the JMS (actually Message queue) server is up, you can periodically lookup for the connecting factory in the directory server, if the factory is not bound you get a NamingException with a specific message, If you don't get that exception + message the JMS server might be up. But I am not sure whether the JNDI objects (like connection factory, destination) are unbound when the JMS server is shutdown, if not you can do an additional check when you create the respective connection objects.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!