This page describes how to use sessions in Azure Service Bus to group messages from the same source into same receivers.
In session-less queue processors I can control how many messages I may get in parallel:
new OnMessageOptions { MaxConcurrentCalls = 10 };
If I pass these options, no more than 10 messages will be handled at the same time.
Now, for session-ful processors the options are replaced by
new SessionHandlerOptions { MaxConcurrentSessions = 10 };
Which has a different meaning of no more than 10 sessions at the same time.
My sessions are relatively long-lived, and mostly idle, so I have to set this parameter to high value. However, I still want to limit the amount of parallel messages.
Is that possible out of the box?
What would the practical limit of parallelization be if I set MaxConcurrentSessions
to int.MaxValue
?
MaxConcurrentSessions
. Say, my idle timeout is 1 min, each message takes 1 sec to process and I want to handle 10 concurrent messages max. Then I kind of have to setMaxConcurrentSessions
to 60*10. But that probably means SB will accept 600 new sessions at the same time? – Outmarch