-
Notifications
You must be signed in to change notification settings - Fork 5
Service Bus message auto-renewal timeout #32
Description
Messages are received from Service Bus using the PeekLock receive mode. In this mode, when a message is received, it is locked for a period of time. Once that lock expires, the message is available to be delivered again, unless the message is completed before the lock expires.
When registering a message handler, the Service Bus SDK, by default, implements a mechanism to auto-renew message locks. This allows a message handler to continue to process a message for longer than the message lock duration configured on a queue. However, this mechanism has a default timeout of 5 minutes. This means that after 5 minutes, message locks stop being automatically renewed. If the message processor attempts to complete a message after this timeout, it will likely receive an exception indicating that the lock has been lost.
Other queue implementations don't behave in this way, and messages don't automatically become available to be delivered again unless they are explicitly acknowledged, or if the connection to the message broker is lost.
For consistency between the various abstractions, we should override the Service Bus auto-renew timeout. Ideally, we'd set this to be as large a value as is supported.