我有一个场景,我从服务总线接收消息来触发工作流程。该工作流程进行了一些处理,但最终将一些数据插入SQL DB中。当100,000个消息立即出现时,数据库就会不知所措。
有没有一种方法可以限制并发实例的数量?
这是我的测试
这会收到一条非会话消息,有2分钟的延迟,然后A组成只是为了进行最终活动。
如果我提交10条消息,请启用工作流程,立即使所有10条消息都会导致10个工作流激活。
这是我的host.json文件
I have a scenario where I receive messages from service bus to trigger a workflow. This workflow does some processing but ultimately inserts some data into SQL DB. When 100,000's of messages appear at once, the DB gets overwhelmed.
Is there a way of restricting the number of concurrent instances?
Here is my test

This receives a non session message, has a 2 minute delay, then a compose just to ad an end activity.
If I submit 10 messages, enable the workflow, immediately all 10 messages cause 10 workflows to activate.

Here is my host.json file

发布评论
评论(2)
逻辑应用标准在Azure函数上运行,因此您应该能够使用
host.json
设置:您还可以使用AppSettings设置此设置(请参见现有答案):
Logic App standard runs on Azure Function so you should be able to limit the numbers of concurrent calls using
host.json
settings:You could also set this setting using appsettings (see existing answer):
您可以在应用程序级别应用并发控制(与托马斯建议的类似概念相似,但是逻辑应用程序有特定的切换)。下面的链接指向这些值:
https://learn.microsoft.com/en-us/azure/logic-apps/edit-app-settings-host-settings?tabs=visual-studio-code#trigger-conconcorrency
值您正在寻找的是runtime.trigger.maximumrunconcurrency(这在hosts.json中应用)。文档中有一些有关如何设置主机的指导(滚动一点)。
另一个选项是删除拆分,因此您会收到一个带有所有消息的数组,并使用for-each循环,在该循环中,您可以在循环并发上获得更多控制。
我希望这会有所帮助。
欢呼,瓦格纳。
You can apply concurrency control at the app level (similar concept to what Thomas suggested, but there are specific toggles for Logic Apps). The link below points to those values:
https://learn.microsoft.com/en-us/azure/logic-apps/edit-app-settings-host-settings?tabs=visual-studio-code#trigger-concurrency
The value you are looking is Runtime.Trigger.MaximumRunConcurrency (and this is applied in the hosts.json). There is some guidance in the document on how to setup host.json (scroll up a bit).
Another option is to remove the split on, so you receive an array with all the messages and use a for-each loop, where you have more control on loop concurrency.
I hope this helps.
Cheers, Wagner.