JMS Artemis DLQ Message lost when having an active consumer on DLQ

Setup:

  • Spring Boot 2.7.1
  • ActiveMQ Artemis (not embedded)
  • Individual DLQ per Queue as ANYCAST.

The setup basically works fine except as soon as I am adding a @JmsListener that listens to the DLQ.

So I have multiple JmsListener where one listens to a regular queue q1. In case the action fails twice the message is moved to the assigned DLQ DLQ.q1.

This works as long as at this point in time there is no active consumer for DLQ.q1. The messages are stored in the DLQ.

As soon as the consumer (JmsListener) for the DLQ.q1 is enabled, the dead letters from q1 do not appear in the DLQ and are also not consumed. The message, total added messages, and messages killed from the DLQ still show 0.

Consuming a message that was directly sent to the DLQ works either.

Can it be problematic when having an active listener on the DLQ? Is there anything special to take care of?

  • Have you configured the broker to automatically create dead-letter resources? How exactly is the JmsListener on the DLQ configured?

    – 




Leave a Comment