I am trying to understand the difference between:
- serverWaitTime (in ISessionClient.AcceptMessageSessionAsync(String, TimeSpan)) ( https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.isessionclient.acceptmessagesessionasync?view=azure-dotnet#Microsoft_Azure_ServiceBus_ISessionClient_AcceptMessageSessionAsync_System_String_System_TimeSpan_) and
- operationTimeout (in IMessageReceiver.ReceiveAsync(TimeSpan)) (https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.core.imessagereceiver.receiveasync?view=azure-dotnet#Microsoft_Azure_ServiceBus_Core_IMessageReceiver_ReceiveAsync_System_TimeSpan_) in Azure Service Bus SDK.
The documentation provides following text on both:
- serverWaitTime: Amount of time for which the call should wait for to fetch the next session.
- operationTimeout: The time span the client waits for receiving a message before it times out.
In my experimental code, ISessionClient.AcceptMessageSessionAsync(session, serverWaitTime) seem to return immediately (even when large number of sessions are being created) where as IMessageReceiver.ReceiveAsync will definitely wait for supplied operationTimeout before timing out if the message with that session is not available.
Hence I am wondering if serverWaitTime means something else that I do not understand.
- Are both related to client side timeouts only?
- If that is true, then why call one serverWaitTime vs operationTimeout?