Back Forum Reply New

DefaultMessageListenerContainer lifecycle method semantics

I need to use the Lifecycle methods of the DefaultMessageListenerContainer (actually inherited from AbstractJmsListeningContainer) like start and stop.

Now Iquot;m running into a situation that I cannot decipher.
I'm starting up the container and at a certain point, stopping it.
In some cases (like when the listeners are actually consuming messages), and receive a stop signal, the messages are quot;rejectedquot; by the container. This appears as a warning level log. And after this, when the container is restarted, it seems to consume messages that arrive after the start, but the messages that weren't consumed, remain on the queue.
Code:
Dec 23, 2008 10:12:23 PM org..jms.listener.AbstractMessageListenerContainer doExecuteListener
WARNING: Rejecting received message because of the listener container having been stopped in the meantime: ActiveMQMapMessage {... }
This problem (not the exception, but the messages not being consumed) occurs only sometimes. I have a strong feeling it is because of an ActiveMQ recovery setting, however, I just want to be sure that Spring has nothing to do with the messages not being received or redelivered.

That said, what are the exact semantics of start and stop. When a listener container stops, what actually happens? Will any state be lost? will new instances of listeners be created...a little light would be a relief!
¥
Back Forum Reply New