2

I started using Anypoint MQ Subscribe with Max Redelivery Countset to 2.

Application should throw ANYPOINT-MQ:RETRY_EXHAUSTED exception after 2 failed deliveries, but the message was returned back to main queue and picked up again in the next batch.

I am trying to put the messages in DLQ manually after 2 failed deliveries using Try scope.

Any idea, how to put the messages in DLQ manually?

user1228
  • 151
  • 6
  • 2
    This is solved. Anypoint MQ throws retry exhausted error after failed reconnection attempts and not for failed deliveries. To put message manually, I check deliveryCount assoicated with each message. – user1228 Sep 04 '20 at 18:51

1 Answers1

1

Errors related to anypoint-mq:RETRY_EXHAUSTED or HTTP: RETRY_EXHAUSTED, always occurs when it failed to connect to any point mq or http request to any other service.

When you set retry connection strategy in connector like retry 2 time then connector tries to connect 2 times and after that still no connection then we will get retry exhausted error

To catch that error and see message to DLQ, do categorisation of error in on error propagate use type ANYPOINT-MQ:RETRY_EXHAUSTED Or HTTP:RETRY_EXHAUSTED based on which connector you are using.

Then it will catch that error and then inside on error propagate use any logic like send message to file or dlq whatever but there also if it fails to send to file then put a logger with proper details to track the message without losing it

Thanks

Anurag Sharma
  • 780
  • 7
  • 31
  • Please use correct punctuation marks, and utilize code blocks (search for Markdown inline code blocks). – HappyFace Oct 19 '20 at 02:23