• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS MDP listener: stop/start/restart?

 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



How can I have a handle on the queue listener (queueMessageListener) so that I can stop/start/restart?
For example, when the jms:listener-container is up but some how the queue listener did not pick up
the messages when I put some message into the queue. 1M Thanks.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

For example, when the jms:listener-container is up but some how the queue listener did not pick up



That should not happen there is the equivalent of a while(true) in the container looping and waiting for a message. If you set your logging to TRACE your log will be flooded with the messages from this.

Typically stopping, starting and restarting would be a good job for JMX. If you take a look at Spring Integration all of these niceties are there for you out of the box. Also with Spring integration you can alternatively autowire the adapter into a service which you could access from a UI and call the lifecycle events on it.



 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Trace set.
2. Have a quick look at JConsole.
3. Is this what you meant for Spring Integration, for example



4. DI into a web controller for example and use it for start/stop

 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup that is the idea They have implemented all the smart life cycle events. If you wanted to investigate further your JMX options as well you can check out this presentation by Garry Russel http://www.infoq.com/presentations/Managing-Spring-Integration also have a look at the reference docs. The orderly shutdown stuff is really nice http://static.springsource.org/spring-integration/reference/htmlsingle/#jmx-shutdown This allows in flight messages to complete while not accepting new messages. Very handy when you need to take things down in an orderly manner and the inbound/outbound adapters must be taken down in a specific order.

here is another video much the same but on youtube http://www.youtube.com/watch?v=TetfR7ULnA8

Anyways hope that helped you.
reply
    Bookmark Topic Watch Topic
  • New Topic