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.
source share