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

  • Error handling.

    Hi all,
    I am using spring integration with amqp. I need to route my error messages into rabbit queues after my retry interceptor advice chain has done retry.
    How can I specify an error channel in my inbound- adapter advice chain after the retry policy is completed so that it will re-queue the error message into multiple error queues.


    Thanks in advance for the help.

  • #2
    Probably the easiest way is to set up the queue with a Dead Letter Exchange and use a RejectAndDontRequeueRecoverer on the retry advice, and the messages will be sent to the DLX; you can then bind whatever queues you want to the DLX.

    There was a recent discussion about it here... http://forum.springsource.org/showth...etry-max-times

    Comment


    • #3
      Hi!

      AS I understand you're using advice-chain on the <amqp:inbound-channel-adapter>.
      So, there is another useful attribute for your wishes - error-handler. The provided one will be invoked exectly after your retry will be exhausted: AbstractMessageListenerContainer#executeListener
      And there is an ErrorHandler implementation out of the box - MessagePublishingErrorHandler.
      I think it may resolve your requirements.
      Nevertheless IMO it's bad idea to make retry on the listener. If your Message causes an Exception in the downstream flow it's not a problem of AMQP-Listener. The real issue may lie inside some of your services. So, why don't do retry there.
      Take a look here: http://static.springsource.org/sprin...r-advice-chain
      https://github.com/SpringSource/spri...retry-and-more
      Maybe it will change your mind.

      Cheers,
      Artem

      Comment


      • #4
        Hi,
        @cleric @gary,
        I've implemented
        Dead Letter Exchange and use a RejectAndDontRequeueRecoverer on the retry advice, and the messages will be sent to the DLX
        I have multiple inbound adapters.But I need some mechanism to route message from my Dead Letter Exchange to different queues. How can I achieve this. Is there some way that I can add some routing key so I can route it from there.

        Comment


        • #5
          Is there some way that I can add some routing key so I can route it from there.
          But how about this one: x-dead-letter-routing-key along with x-dead-letter-exchange?
          In this case you can configure each your original queues for the same Direct DLX, but with unique x-dead-letter-routing-key.
          And further you should configure binding for those DL-keys and their queues as for regular ones.

          Comment


          • #6
            Originally posted by Cleric;435113x-dead-letter-routing-key along with [B
            x-dead-letter-exchange[/B].
            Thanks a ton cleric.
            That did the job for me .

            Comment

            Working...
            X