-1

I have set up a spring boot rabbitmq integration, the integration works fine. I am sending messages to a queue and consuming from the queue. If any error occurs, the message gets retried a set amount of times after which the message is placed on an error queue, I would like some guidelines on implementing a functionality in which i can send an email to some one to notify them that messages have failed and have been routed to an error queue, currently once a message gets onto the error queue, it just lives there and no action is taken.

SEED
  • 57
  • 1
  • 12

1 Answers1

0

You need to show your configuration (edit the question, don't try to put it into a comment).

You need to add a MessageRecoverer to the retry interceptor.

The recoverer is called when retried are exhausted so you can do anything you like there. If the recoverer then throws an exception, the message will go to the DLQ as normal.

Or, after sending the email, you can call a DeadLetterPublishingRecoverer and the message will go to a queue with enhanced information in headers (error message, stack trace etc).

Gary Russell
  • 166,535
  • 14
  • 146
  • 179