• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

What Happens to JMS Listener if JMS Server goes down?

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nathanial, I will think along the lines. I am using MQ Series by the way.
 
Are you okay? You look a little big. Maybe this tiny ad will help:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic