Azure 逻辑应用从存储队列读取消息但不处理

标签 azure azure-logic-apps azure-storage-queues

我正在设置一个 Azure LogicApp 以从存储队列读取消息并将消息发布到 API 端点:

enter image description here

LogicApp 按预期触发并记录成功运行。我可以看到我的队列消息已从队列中删除,但随后又被放回到队列中,因为 LogicApp 没有处理 foreach 循环,也没有运行循环中的 DeleteMessage 步骤。

当我查看运行历史记录时,输出区域显示当队列中有消息步骤中的消息,但< strong>获取消息 (V2) 步骤不显示其输出中有任何要处理的 QueueMessage:

enter image description here

我还观察到,在 LogicApp 运行后,该消息已出队并返回,并带有增加的出队计数属性。

为什么第一步会使消息出队?它不是只是检查是否存在消息而不拉取它们吗?如果是步骤 2 拉取了它,那么为什么我在 OUTPUT 中看不到任何消息?

如何正确处理我的队列消息?我想以 32 个为一组(这是最大数量)提取它们,并在 Foreach 循环中处理它们。

最佳答案

Why would the first step dequeue a message? Wouldn't it just check to see if any messages exist without pulling them? If it was step 2 that pulled it then why do I not see any messages in the OUTPUT?

触发器When there are messages in a queue (V2)返回队列中存在的消息以及您无法在获取消息操作中看到消息的原因。

根据您的要求,当您希望每次收到消息时都触发时,可以使用当队列中有消息时 (V2) 连接器的消息文本插入队列。

注意:此流程会触发队列中的每条消息,并将消息多次发送到您的 API 端点。

enter image description here

How can I process my queue messages properly? I would like to pull them in batches of 32 (which is the max amount) and process them in the For each loop.

如果您想批量获取 32 个消息,那么您可以使用除 当队列中有消息 (V2) 以外的任何触发器,然后使用 获取消息 行动。

如果您仅限于使用存储队列连接器,那么您可以使用 When a specified number of messages are in a given queue (V2) , 否则,一个简单的 HTTP 触发器就足以触发逻辑应用。

enter image description here

enter image description here

结果:

enter image description here

关于Azure 逻辑应用从存储队列读取消息但不处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71655224/

相关文章:

azure - CosmosDB 图 : Are per-request consistency levels supported the way they are for documents?

Azure 存储帐户容器公共(public)访问级别已禁用

c# - Azure:无需定义附加配置即可获取服务证书

azure - 将客户端证书添加到单节点 Service Fabric 集群

azure - 如何从逻辑应用程序将值作为日期时间放入Azure表中

转换 XML 时 Azure 逻辑应用忽略缩进 ="yes"

nservicebus - 是否可以在 NServiceBus 中对事件发布者进行范围/分组?

azure - 逻辑应用程序 : What is the "evaluatedRecurrence" trigger property?

visibility - Azure 队列 - 功能 - 消息可见性 - 工作人员?