gpt4 book ai didi

javascript - azure队列触发函数从两个不同的队列中拉取

转载 作者:行者123 更新时间:2023-12-02 06:54:52 26 4
gpt4 key购买 nike

如何让单个 azure 队列触发函数连接到两个不同的队列。

有两个像这样的绑定(bind)似乎会破坏它:

{
"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"
}
]
}

如果可能的话,我希望一个队列优先于另一个队列。这样,如果 priority 为空,main 只会将作业发送到该函数,否则它将从 priority 获取作业,直到空为止。

最佳答案

您无法为单个队列触发函数放置多个输入绑定(bind)队列,但可以为同一队列触发函数使用多个输出绑定(bind)。

enter image description here

enter image description here

我相信该函数针对单个指定的队列消息运行,而不是使用消息数组作为输出绑定(bind)对象同时针对多个队列消息运行。

我们还可以从同一个队列中获取多条消息。

请参阅 SO ThreadMS Doc有关详细信息,请参阅 Azure Functions 绑定(bind)示例。

关于javascript - azure队列触发函数从两个不同的队列中拉取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73561819/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com