Azure / Azure/azure-sdk-for-rust
[Service Bus] Add prefetch and link credit control
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
## Summary
The receiver has no prefetch setting, and link credit is not exposed or tuned.
## Motivation
`ServiceBusReceiverOptions` carries `PrefetchCount`, and it defaults to 0. Prefetch changes the lock semantics, because prefetched messages hold their locks while they sit in the client buffer, so it interacts with lock renewal and with the settlement paths in #4943 and #4944.
A processor needs it as well. `ServiceBusProcessor` exposes `PrefetchCount` and `UpdatePrefetchCount`.
## Proposal
- Add a prefetch count to the receiver options, and default it to 0.
- Map prefetch onto AMQP link credit.
- Document the interaction with the peek lock duration, because a large prefetch on a slow consumer loses locks.
## Dependencies
Blocked by:
- #4940 [Service Bus] Add a recoverable connection and link layer
Sub-issue of #4934.
Contributor guide
Research direction
Start with the recoverable connection and link layer in #4940, then inspect ServiceBusReceiverOptions and the ServiceBusProcessor APIs mentioned in the issue. Trace how receiver settings become AMQP link credit and review the lock-renewal and settlement interactions from #4943 and #4944. Done means receiver and processor prefetch behavior is exposed, defaults to zero, and the lock-duration tradeoff is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, rust
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100