Posts

Showing posts with the label dead letter

Help Your Messages Find Peace: A Guide to Dead Letter Queues in RabbitMQ 💀✉️

Image
    Exceptions can happen anytime and if you don't know how to handle them, then you have got a problem. Or maybe you just haven't checked out my post about exception handling. NET Global Exception Handling: 3 Techniques Beyond Try/Catch Blocks . Anyway, because of that you need to plan what to do if an exception happens during processing a message that you received from a  RabbitMQ queue. You have two options: Negatively Acknowledge (Nack) Using BasicNack:  This method is more flexible. It allows you to negatively acknowledge one or more messages. It takes three parameters: the delivery tag of the message to nack, a boolean indicating whether to nack multiple messages, and a boolean indicating whether to requeue the message.  If the multiple parameter is true, all messages up to and including the one with the specified delivery tag are nacked. If the requeue parameter is true, the nacked messages will be requeued. If it's false, the messages will be dis...