Azure / Azure/azure-sdk-for-rust
[Service Bus] Add session support
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
## Summary
Sessions are not implemented. `Message` carries a `session_id` and the error kinds list `SessionLockLost`, but there is no session receiver, no way to accept a session, and no session state.
## Motivation
Sessions are how Service Bus provides ordered, single consumer processing over a partitioned queue. `ServiceBusSessionReceiver` extends the receiver with `SessionId`, `SessionLockedUntil`, `RenewSessionLockAsync`, `GetSessionStateAsync`, and `SetSessionStateAsync`. `ServiceBusClient` adds `AcceptSessionAsync` and `AcceptNextSessionAsync` for queues and for subscriptions.
A session receiver settles every message over the management path, so this issue cannot start before #4944.
## Proposal
- Add a session receiver that accepts a named session and one that accepts the next available session.
- Implement `com.microsoft:renew-session-lock`, `com.microsoft:get-session-state`, `com.microsoft:set-session-state`, and `com.microsoft:get-message-sessions`.
- Surface the session identifier and the locked until time.
- Map a lost session lock onto the `SessionLockLost` reason from #4938.
## Dependencies
Blocked by:
- #4944 [Service Bus] Add the management settlement path for messages off the current link
- #4945 [Service Bus] Lock token handling is wrong for deferred messages and for the GUID encoding
Sub-issue of #4934.
Contributor guide
Research direction
Start by reading blockers #4944 and #4945, then inspect the existing Service Bus receiver and ServiceBusClient entry points. Use the listed session receiver members and management operations as the scope; done means named and next-session acceptance, session identity and lock timing, state operations, lock renewal, and SessionLockLost mapping are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100