简体   繁体   English

Azure Functions - 拆分队列消息

[英]Azure Functions - Split queue message

Currently we have a legacy system (.net framework library) where a message is queued in service bus queue.目前我们有一个遗留系统(.net 框架库),其中一条消息在服务总线队列中排队。 There is windows service, which has multiple message handlers (custom classes for processing a message).有 windows 服务,它有多个消息处理程序(用于处理消息的自定义类)。 We have a logic to split the message from queue into these message handlers.我们有一个逻辑将消息从队列中拆分为这些消息处理程序。 Ratio of split is 90% and 10% into these message handlers.拆分到这些消息处理程序的比率为 90% 和 10%。

We are planning to migrate this legacy system into azure function/durable function, where we could have a queue trigger to process a message.我们计划将这个遗留系统迁移到 azure 函数/持久函数中,在那里我们可以有一个队列触发器来处理消息。 We could have multiple azure functions, one for each message handler in legacy system.我们可以有多个 azure 函数,一个用于遗留系统中的每个消息处理程序。 Challenge we face is how do we handle splitting of messages into these azure function?我们面临的挑战是如何处理将消息拆分为这些天蓝色的函数?

For eg: Azure-Function-1 should take 90% of the queue message, Azure-Function-2 should take 10% of the queue message.例如:Azure-Function-1 应占队列消息的 90%,Azure-Function-2 应占队列消息的 10%。

My question is does azure has out-of-the-box solution for handling messages in such a scenario?我的问题是 azure 是否有开箱即用的解决方案来处理这种情况下的消息? Is there any other better solution than Azure functions/durable functions?还有比 Azure 函数/持久函数更好的解决方案吗?

This not how it works.这不是它的工作原理。 The number of functions is determined by the number of events.函数的数量由事件的数量决定。 So if your Azure-Function-1 has more messages then Azure-function-2, changes are it will have more copies of your function in execution.因此,如果您的 Azure-Function-1 具有比 Azure-function-2 更多的消息,则更改是它将有更多的函数副本在执行中。

If you have very large number of messages, maybe you could switch to Event Hubs where you can determine (only in advance) the number of partitions and Throughput Units.如果您有大量消息,也许您可​​以切换到事件中心,在那里您可以(仅提前)确定分区和吞吐量单位的数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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