Service Bus PeekLock issue with Azure Function on Exceptions

86 Views Asked by At

this is a duplicate of this is question but I am posting it here again as It seems to work but after I catch an exception , my messages moves to dead-letter message count. Is there any timeout property or any thing I can do to just stop letting the messages get completed.

1

There are 1 best solutions below

0
On BEST ANSWER

By design, messages get requeued when an uncaught exception occurs. This happens until the maxDeliveryCount property is reached (by default 10 times). If you don't want the messages to get deadlettered and requeued, you need to catch the exception and not throw it.