Resending a dead letter queue message - Azure Service Bus

I have created a service bus queue in Azure and it works well. And if the message is not delivered by default (10 times), it correctly moves the message to the dead letter queue.

Now I would like to resend this message from the dead letter queue back to the queue where it came from, and see if it works again. I tried the same with a service bus explorer. But he immediately moves into the line of dead letters.

Is it possible to do the same, and if so, how?

+5
source share
4 answers

The Service Bus Explorer tool always creates a clone of the original message when restoring and resending the message from the error queue. It could not be otherwise, because by default Service Bus does not provide any mechanisms for message recovery and resending. I suggest you investigate why your message ends in a queue with an invalid name, as well as its clone, when you resend it. Hope this helps!

+1
source

You will need to send a new message with the same payload. ASB by design does not support resending messages.

+2
source

It looks like this could be due to ASB duplicate message detection functionality.

When you resend the message in the ServiceBus Explorer, it will clone the message, and thus the new message will have the same identifier as the original message in the error queue.

If you turned on "Re-discovery is required" in the queue / topic, and you try to resend the message in the "Repeat detection history window" window, the message will be moved to the queue again with an error.

If you want to use Service Bus Explorer to resend non-delivery messages, I think you will have to turn off "Required duplicate discovery" in the queue / topic.

+1
source

This could be a “double message detection” as pointed out by Peter Berggreen , or more likely if you directly move BrokeredMessage from the dead letter queue to the direct queue, then DeliveryCount will still be at its maximum and it will return to the dead letter queue.

Pull the BrokeredMessage out of the dead letter queue, get the content using GetBody (), create a new BrokeredMessage with this data and send it to the queue. You can do this in a secure homestead by using a peek to get the contents of a message from a dead letter queue, and then sending a new message to a live queue before deleting a message from the dead letter queue. This way you won’t lose important data if for some reason it cannot write to the queue in real time.

With the new BrokeredMessage, you should have no problem with “detecting duplicate messages,” and DeliveryCount will reset to zero.

0
source

Source: https://habr.com/ru/post/1263183/


All Articles