DEV Community

Discussion on: Ordered queue processing in Azure Functions with Sessions

Collapse
 
eltavodev profile image
ElTavo

Hi Jeff, excellent post, what happen if we have more than 32 messages for a specific session?

Collapse
 
jeffhollan profile image
Jeff Hollan

When a function places a lock on a session, it may make multiple requests to get many messages. You could have thousands of messages for the same session, the function app will process one at a time and then go back and ask service bus for the next one. With sessions you could even send a message to a session 1 year later, a function app will wake up, lock the session, and process that message. So really no limit to how many or how frequently you can push messages to a session.

In the case of sessions, because each message must be processed in order, you really get the concurrency from having multiple sessions processed at once on an instance, but to preserve ordering only one message from a session will be pulled at a time (if that makes sense)

docs.microsoft.com/en-us/azure/ser...