activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s-bolz <>
Subject How can I use session recovery with a (Spring) DefaultMessageListenerContainer?
Date Tue, 12 Dec 2006 12:29:14 GMT


I have searched the web for the whole morning now and couldn't find a way to
solve my problem. So maybe anyone from you can help.

I use a org.springframework.jms.listener.DefaultMessageListenerContainer as
a Container for each Message Listener, I have set up durable Subscriptions,

My listeners gather their messages in a batch and after the batch has
reached a certain size (1000) write them into a database. After the batch
has been written the messages are acknowledged (and the batch cleared of

The point is, that if the listeners shut down (planned or unplanned) there
might still exist some unprocessed messages. After restart they shall be
sent again to the Listeners so that they can then be processed and written
into the database.

I have found out that I need to use session.recover() after the restart of
the listeners. But since I use the DefaultMessageListenerContainer I cannot
access the session directly.

I know, this looks more like a Spring problem and I have posted the question
there as well, but I still would like to know your oppinion. Maybe my
approach can be optimized or someone can even think of a workaround.

Any help / suggestions / links would be highly appreciated.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message