Keeping messages in queue in case of receiver crash

Posted by John Doe on Stack Overflow See other posts from Stack Overflow or by John Doe
Published on 2010-04-12T16:14:44Z Indexed on 2010/04/17 5:13 UTC
Read the original article Hit count: 227

Filed under:
|
|

Hi,

We've a Spring JMS message listener container for receiving messages asynchronously. Using DefaultMessageListenerContainer and in sessionTransacted mode. I understand being in sessionTransacted mode means in case of an exception the message will be put back into the queue. But how can I make sure the message won't be deleted from the queue even if the receiver (which is picked the message) crashes or just the machine running it looses power?

At first I thought CLIENT_ACKNOWLEDGE acknowledge mode should save me, but apparently it's not the case, Spring calls .acknowledge() no matter what.

So here's my question, how can I guarantee the delivery? Using a custom MessageListenerContainer? Using a transaction manager?

© Stack Overflow or respective owner

Related posts about jms

Related posts about spring