Aug 15th, 2008, 04:25 PM
poisoned pill / redelivery count
I am wondering if it is possible on the level of
DefaultMessageListenerContainer to redirect messages with certain redelivery count to a dead letter queue. I am currently using OpenMQ which does not allow to set redelivery count on messages; so, if I get a message which causes consumer to throw an exception and subsequently roll back the transaction I will get into no ending loop. Message is sent back to queue, then I read it from queue, roll back, send it back to queue... forever.
Does Spring provide a capability to prevent poisoned pills from bringing the system down?
Aug 18th, 2008, 11:30 AM
No.... there is no default mechanism for doing so. The issue lies mostly with the different JMS implementations as different vendors have specific ways of dealing with the retryCount. If worse comes to worse, you may have to include a retry count in the actual body of the message.