This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes What Happens to JMS Listener if JMS Server goes down? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "What Happens to JMS Listener if JMS Server goes down?" Watch "What Happens to JMS Listener if JMS Server goes down?" New topic
Author

What Happens to JMS Listener if JMS Server goes down?

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Hi
Some confusion about this, need help. If I have a JMS Listener client at a client machine listening to a Queue on JMS Server. The JMS Server goes down! what will happen to the Listener?
1- Will it throw exception?
2- It will keep listening to nothing? i.e. the JMS Listener client will never know the Server is down?

If the listener will never know about the server being down then:

1- Will it start receiving the messages as soon as the Server comes up? i.e. the connection is never lost?

2- Will have to restart the listener? In that case how can the client JMS Listener ever know when to reconnect?

Thanks for the help in advance.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I'm assuming you're talking about javax.jms.MessageListener here. If your server goes down, the listener wouldn't know a thing, since it's only concerned with messages actually being consumed (since none are at that point, it's oblivious to the situation). You should check into using javax.jms.ExceptionListener. Note that the spec says that JMS providers should attempt to correct problems before propogating the exception to the ExceptionListener. Assuming you have a nice provider, it would reconnect so your MessageListener works as expected. But do check your JMS provider's documentation.

As for your "middle" question .... as long as your subscriber is durable you shouldn't have any issues. You can read all about the durability issues in the spec or somewhere else -- I read the O'Reilly JMS book -- run reading.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Thanks Nathanial, I will think along the lines. I am using MQ Series by the way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What Happens to JMS Listener if JMS Server goes down?
 
Similar Threads
JMS Server Restart
Configuration of WAS6.0.1 JMS provider!
If JMS Server crashes, what happens to Standalone JMS Listener Client
JMS Topic with high availability for the client?
Alert mechanism when Message Listener is down on Websphere