'Service Bus Dead Letter Queue Processing In Azure Functions

My environment.

  • dotnet 6
  • Azure Functions ( dotnet-isolated)
  • Azure Service Bus

Now I have two functions with ServiceBusTrigger. One handle main queue message and another for handling dead letter queue message.

Scenario

  • When main queue message process get failed ( for 2 times) then message moves to dead letter queue.
  • Now it trigger the dead letter queue message and start retrying. Here it seems to be infinite loop. How to move message to another queue if it is failing at DLQ level. Is there any way to resubmit message to queue again.

Update-1

  • Scenario is that there is something wrong with consumer that processing that message.
  • Now when message first land in Main queue and then it process by consumer and something went wrong due to some dependency issue with consumer. So after some retry message will land in DLQ.
  • Now DLQ use same business code to process message but it is from different function. As there is something wrong with dependency so again message will get fail. Now in DLQ it processing infinite. I want to move this message to some other queue and from there some manual intervention required to process that message further.
  • In high traffic application it is possible that before above decision has made there are many message in queue/DLQ.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source