activemq-users mailing list archives

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

Hi,

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,
and use CLIENT_ACKNOWLEDGE mode.

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
course).

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.

Thanks!
Sebastian
-- 
View this message in context: http://www.nabble.com/How-can-I-use-session-recovery-with-a-%28Spring%29-DefaultMessageListenerContainer--tf2807243.html#a7832261
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message