aspose file tools*
The moose likes Spring and the fly likes JMS MDP listener: stop/start/restart? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "JMS MDP listener: stop/start/restart?" Watch "JMS MDP listener: stop/start/restart?" New topic
Author

JMS MDP listener: stop/start/restart?

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 461
    
    4



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.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1649
    
    7

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.




[How To Ask Questions][Read before you PM me]
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 461
    
    4
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

Joined: Mar 07, 2010
Posts: 1649
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS MDP listener: stop/start/restart?