In the latest preview version of the v7 of the Service Bus package, the builder is used to build a receiver client when one wants to receive messages from
- queue/subscription that does not have sessions enabled
- a single session in a queue/subscription
- any next available session in a queue/subscription
- multiple concurrent sessions in a queue/subscription
The links are established lazily when the the first call to any method on the client is made.
This is not ideal in case of a single session, because the client is not guaranteed to work as expected.
The service determines whether or not it can get a lock on the session that is asked for and can throw an error.
When asked for next available session, the operation can time out.
The older Service Bus library solved this by having dedicated method called acceptMessageSession() that captured the above essence.
What we need is a builder that can build a client asynchronously so that we can communicate with the service whether the client can be built or not. Since we builders generally do not have, we are proposing an intermediate client that can be built using the builder and will have the "accept" methods to get a receiver client for given session or next available session
API View: https://apiview.dev/Assemblies/Review/64f40be9988242c9a8facc8a20c5e9e7
- sessionReceiver() builder creates a new client
ServiceBusSessionReceiverClient and ServiceBusSessionReceiverAsyncClient
- These new clients will have 2 methods
AcceptSession() which takes a sessionId and AcceptNextSession() that will return a ServiceBusReceiverClient/ServiceBusReceiverAsyncClient which will be tied to a single session
- These new clients will have a 3rd method
getReceiverClient() which takes maxConcurrentSessions as a parameter and will also return a ServiceBusReceiverClient/ServiceBusReceiverAsyncClient which will be tied to multiple sessions.
In the latest preview version of the v7 of the Service Bus package, the builder is used to build a receiver client when one wants to receive messages from
The links are established lazily when the the first call to any method on the client is made.
This is not ideal in case of a single session, because the client is not guaranteed to work as expected.
The service determines whether or not it can get a lock on the session that is asked for and can throw an error.
When asked for next available session, the operation can time out.
The older Service Bus library solved this by having dedicated method called
acceptMessageSession()that captured the above essence.What we need is a builder that can build a client asynchronously so that we can communicate with the service whether the client can be built or not. Since we builders generally do not have, we are proposing an intermediate client that can be built using the builder and will have the "accept" methods to get a receiver client for given session or next available session
API View: https://apiview.dev/Assemblies/Review/64f40be9988242c9a8facc8a20c5e9e7
ServiceBusSessionReceiverClientandServiceBusSessionReceiverAsyncClientAcceptSession()which takes a sessionId andAcceptNextSession()that will return aServiceBusReceiverClient/ServiceBusReceiverAsyncClientwhich will be tied to a single sessiongetReceiverClient()which takesmaxConcurrentSessionsas a parameter and will also return aServiceBusReceiverClient/ServiceBusReceiverAsyncClientwhich will be tied to multiple sessions.