0

I am trying to understand the difference between:

  1. 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
  2. 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:

  1. serverWaitTime: Amount of time for which the call should wait for to fetch the next session.
  2. 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.

  1. Are both related to client side timeouts only?
  2. If that is true, then why call one serverWaitTime vs operationTimeout?
Raghu
  • 2,859
  • 4
  • 33
  • 65

2 Answers2

0

Both serverWaitTime and operationTimeout parameters represent the same concept - wait time for the client before it gives up.

As for the reason they are called differently, that's a question for the team to be raised in the issue tarcker.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
0

The session client has operation timeout that let's one define a timeout period for all sessions.

Each individual session via AcceptMessageSessionAsync can override that value by supplying the server wait time.