Announcement Announcement Module
Collapse
No announcement yet.
Dead Lettering Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dead Lettering

    RabbitMQ 2.8 supports dead lettering, see http://www.rabbitmq.com/extensions.h...tter-exchanges.

    I use a StatefulRetryOperationsInterceptorFactoryBean and after x tries I want the message to go to the dead letter exchange. As far as I understand the message needs to be rejected after the retries. How can I do that?

    Are there any plans for extended dead lettering support in Spring AMQP?

    Thanks,
    Paul

  • #2
    If you provide a MessageRecoverer to the factory bean (called when retries are exhausted), and it throws an exception, the listener will send a basic.reject which should trigger the DLQ behavior, according the the RabbitMQ docs.

    DLQ configuration is controlled by queue arguments; spring-amqp supports this in a number of ways, such as...

    Code:
    <rabbit:queue id="queue1">
    	<rabbit:queue-arguments>
    		<entry key="x-dead-letter-exchange" value="my.dlq.exchange" />
    	</rabbit:queue-arguments>
    </rabbit:queue>
    However, there have been some rabbit API changes and the 1.0.0.RELEASE doesn't support 2.8.0.

    I do have a branch on my clone that supports the newer API https://github.com/garyrussell/sprin.../tree/AMQP-195 and I have tested it against 2.8.0 if you want to experiment with DLQs.

    We expect to release this in 1.0.1 shortly.

    Comment


    • #3
      Sorry - my mistake, I see we have to set requeue to false on the reject to invoke DLQ behavior.

      Please open an improvement JIRA here...

      https://jira.springsource.org/browse/AMQP

      Thanks

      Comment


      • #4
        I have pushed a prototype implementation here... https://github.com/garyrussell/spring-amqp/tree/dlq

        As noted in the commit comment, there is currently a problem with dead-lettering messages sent to durable queues, but I have tested without issue with non-durable queues.

        The Rabbit guys know about the problem and it will be fixed in an upcoming release.

        Comment


        • #5
          Thanks Gary! Any idea when the 1.0.1 release will be out?

          Comment


          • #6
            The release (now called 1.1.0.RELEASE) will be announced imminently, once we get the documentation up on the SpringSource web site; the jars should be in maven central already.

            It uses spring-retry-1.0.1.RELEASE, which fixes a problem with the exponential back-off policy when you use the retry interceptor.

            In order to send the message to the DLE/DLQ, the MessageRecoverer must throw an AmqpRejectAndDontRequeueException. This signals the listener container to reject the message, with requeue set to false, causing the message to be sent to the Dead Letter Exchange.

            Update your POMs, and give it a shot!

            For users not using retry, where you want to immediately send to the DLE/DLQ if one attempt fails, you can simply set requeue-rejected to false (defaults to true) on the container.

            Comment

            Working...
            X