[英]azure queue trigger function pull from two different queues
How can I have a single azure queue trigger function connect to two different queues.如何让单个 azure 队列触发器 function 连接到两个不同的队列。
Having two bindings like this seems to break it:有两个像这样的绑定似乎打破了它:
{
"disabled": false,
"bindings": [
{
"type": "queueTrigger",
"direction": "in",
"name": "theQueueItem",
"queueName": "main",
"connection": "QUEUE_CONNECTION_STRING"
},
{
"type": "queueTrigger",
"direction": "in",
"name": "theQueueItem",
"queueName": "priority",
"connection": "QUEUE_CONNECTION_STRING"
},
{
"name": "starter",
"type": "durableClient",
"direction": "in"
}
]
}
If possible I would like one queue to take priority over the other.如果可能的话,我希望一个队列优先于另一个队列。 Such that main
would only send jobs to the function if priority
was empty, otherwise it would take jobs from priority
until empty.这样,如果priority
为空, main
只会将作业发送到 function,否则它将从priority
接收作业直到为空。
You cannot place the multiple Queues of Input bindings for the single Queue Trigger Function, but you can use the multiple output bindings for the same Queue Trigger Function.您不能为单个队列触发器 Function 放置多个输入绑定队列,但您可以为同一个队列触发器 Function 使用多个 output 绑定。
I believe the function runs for single specified queue message not for the multiple queue messages at the same time using message array for the output binding object.我相信 function 为单个指定的队列消息而不是同时为多个队列消息运行,使用 output 绑定 object 的消息数组。
And we can also get the multiple messages from the same queue.我们还可以从同一个队列中获取多条消息。
Refer to the SO Thread and MS Doc of Azure Functions Binding Samples for more information.有关详细信息,请参阅 Azure 函数绑定示例的 SO Thread和MS Doc 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.