ActiveMQ’s / AWS Amazon MQ’s Re-delivery Policy Explained

James Cundle
4 min readAug 7, 2020
ActiveMQ’s Logo

On a recent project with Amazon’s implementation of ActiveMQ (AWS Amazon MQ), we were struggling with what appeared to be the repeated failure of message re-delivery.

Our use case seemed fairly straight forward: we had a client application that was periodically crashing due to an issue processing a queue payload. Whilst having multiple consumers, they all ran on the same code base so despite having a processes monitor to restart them, they would all eventually crash and burn.

As we had a strict FIFO in operation, this meant that one poisoned message could bring all our processing to a halt until we cleared the offending job.

In addition to fixing the application issue, an obvious long term solution was to implement the Message failure and re-delivery mechanisms of AMQ. AMQ has a default Dead Letter Queue (which is customizable) and according to the documentation, messages will be redelivered based on the following situations:

A transacted session is used and rollback() is called.

A transacted session is closed before commit() is called.

A session is using CLIENT_ACKNOWLEDGE and Session.recover() is called.

A client connection times out (perhaps the code being executed takes longer than the…

--

--

James Cundle

I’m a CTO, technical co-founder, Y-Combinator alumni, software engineer, musician, record collector, amateur brewer and qualified wine maker rolled in to one.