简体   繁体   English

azure 队列触发器 function 从两个不同的队列中拉取

[英]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 ThreadMS Doc

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

相关问题 如何在azure javascript函数中的队列触发器中插入队列 - how to insert to queue inside a queue trigger in a azure javascript function Javascript 中的简单 Azure 函数以在队列中使用 HTTP 触发器主体 - Simple Azure Function in Javascript to use HTTP trigger body in queue jQuery两个不同的ID触发相同的功能 - jQuery two different ids trigger the same function 基于两个不同的选择器jquery触发函数 - Trigger a function based on two different selectors jquery 如何堆叠来自两个不同元素的按键事件和单击事件以触发相同的功能 - How to stack a key event and a click event from two different elements to trigger the same function 如何从两个不同的来源提取JSON数据? - How to pull JSON data from two different sources? 有没有办法在 NodeJS Azure Function 延迟的情况下将消息放入 Azure 存储队列? - Is there a way to put a message into an Azure Storage Queue with a delay from a NodeJS Azure Function? 微软 azure 时间触发器 function - Microsoft azure time trigger function 在Azure函数绑定中将引用队列触发消息作为JSON - Reference Queue Trigger Message as JSON in Azure Functions Bindings 在 React 中单击来自不同组件的按钮时触发另一个组件中的函数 - Trigger a function in another component on click a button from a different component in React
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM