Announcement Announcement Module
Collapse
No announcement yet.
How can i modify & reject a received message to rabbit broker? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can i modify & reject a received message to rabbit broker?

    As a amqp-client, spring-amqp really done a pretty nice job in my mq-based email app. Thanks all of spring-amqp-team.

    I use Dead Letter Exchange(DLX) and spring-retry for the bussness exceptions handling when consuming a message.
    When certain exception is throwed, i will retry it. if max-retry-count is exhausted & the message is still not be processing appropriately, i will not requeue it (to the original queue) any more & put it to the dead-letter-exchange.

    There are variety of reasons that lead to fails of message consuming, and I classify them based on custom exceptions. Before put failed message to the DLX, i want add some error-description to this message, So another consumer that listening to the DLX can retrieve & analysis & process it according to the error-description. How can i modifying the failed message, add some extra error-desc to it?

    Here is another thread that i posted on the rabbitmq-discuss:
    http://rabbitmq.1065348.n5.nabble.co...r-td24145.html
    sound like if i want modify the original message, i must use republish instead of reject & DLX, is that true?

    Thanks for the reply! greatly appreciated!

    Regards.

  • #2
    That is correct; you can't modify the original message.

    You can add a custom MessageRecoverer to your retry factory bean and publish a new message to your DLX directly, rather than having the broker publish the original message.

    Comment


    • #3
      Thank you very much, Gary. How warm-hearted you are!

      So i can't modify the original message, even the MessageProperties or headers of it?
      Last edited by Wuaner; Jan 3rd, 2013, 09:48 PM.

      Comment


      • #4
        No, you can't modify the original message at all.
        Last edited by Gary Russell; Jan 4th, 2013, 08:11 AM.

        Comment

        Working...
        X