Skip to content

Commit 20109f4

Browse files
editorial review of recent ASB prefetch and locking changes (#6936)
* editorial review of recent ASB prefetch and locking changes * tweak * Update transports/azure-service-bus/configuration.md Co-authored-by: Adam Ralph <adam@adamralph.com> --------- Co-authored-by: Laila Bougria <laila.bougria@particular.net>
1 parent b1e4420 commit 20109f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

transports/azure-service-bus/configuration.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To disable prefetching, prefetch count should be set to zero.
5050

5151
> [!NOTE]
5252
> The lock duration for all prefetched messages starts as soon as they are fetched. To avoid `LockLostException`, ensure the lock-renewal duration is longer than the total time it takes to process all prefetched messages (i.e., message handler execution time multiplied by the prefetch count).
53-
> In addition, it's important to consider the endpoint's scaling. If the prefetch count is high, the lock may deprive other endpoint instances of messages, rendering additional endpoint instances unnecessary.
53+
> In addition, it's important to consider how endpoints are scaled. If the prefetch count is high, the lock may deprive other endpoint instances of messages, making those instances redundant.
5454
5555
## Lock-renewal
5656

@@ -61,7 +61,10 @@ To ensure smooth processing, it is recommended to configuring the `MaxAutoLockRe
6161
partial: lockrenewal
6262

6363
> [!NOTE]
64-
> Message lock renewal is initiated by client code, not the broker. If the request to renew the lock fails after all the SDK built-in retries (e.g., due to connection loss), the lock won't be renewed, and the message will become unlocked and available for processing by competing consumers. Lock renewal should be treated as a best effort, not as a guaranteed operation.
64+
> Message lock renewal is initiated by client code, not the broker. If a request to renew a lock fails after all the SDK built-in retries (e.g., due to connection loss), the lock won't be renewed, and the message will become unlocked and available for processing by competing consumers. Lock renewal should be treated as a best effort, not as a guaranteed operation.
6565
6666
> [!NOTE]
67-
> If message lock renewal is required, it may be worth checking the duration of the handlers, and see whether these can be optimised. In addition, it may be worth checking whether the prefetch count is too high, considering all messages are locked on peek. This may indicate that too many messages are locked for which the processing exceeds the lock duration.
67+
> The following approaches may be considered to minimize or avoid the occurrence of message lock renewals:
68+
>
69+
> - Optimise the message handlers to reduce their execution time.
70+
> - Reduce the prefetch count. All messages are locked on peek, so when they are prefetched, they remain locked until they are all processed.

0 commit comments

Comments
 (0)