简体   繁体   中英

Does one App Service Plan instance with an Azure Function App process only one message session at a time?

I was reading this article about one Azure Function App instance will only process one message session at a time. So if we look at an App Service Plan with an Azure function app, that still represents one instance. If that is the case, if we had three different message sessions, we need to scale out three app service plan to create three instance of that azure function app to process those message sessions.

在此处输入图像描述

But my assumption may not be correct. When I talk to my coworker, we set our App Service plan's auto-scale to scale out only one instance manually. It's strange cause we see the different message session data are processed in parallel with that one App Service Plan instance based on the sync timestamp. How is this possible? Maybe a single instance of an App Service Plan can have multiple instances of its app?

在此处输入图像描述

I got lots of my reading from this the message session documentation and dev.to article

https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-sessions

https://dev.to/azure/ordered-queue-processing-in-azure-functions-4h6c

在此处输入图像描述

A single compute instance (function in your case) can handle more than a single session. By default, the concurrency on sessions (the number of sessions that can be handled simultaneously) is set to 8. The order is preserved within each session though, so messages per session are delivered in the right order. Your code has to handle the fact that the same code is invoked for different sessions and handle it accordingly. If the code cannot do that, it has to handle sessions serially, reducing the number of concurrent sessions to 1 by changing the default in host.json .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM