我正在設定 Azure LogicApp 以從存盤佇列中讀取訊息并將訊息發布到 API 端點:

LogicApp 按預期觸發并記錄成功運行。我可以看到我的佇列訊息已從佇列中洗掉,但隨后又被放回佇列中,因為 LogicApp 沒有處理 for each 回圈,也沒有運行回圈中的 DeleteMessage 步驟。
當我查看運行歷史記錄時,OUTPUTS區域在當佇列中有訊息步驟中顯示訊息,但獲取訊息(V2)步驟未顯示在其OUTPUTS中有任何 QueueMessages 需要處理:

我還觀察到訊息已出列,并在 LogicApp 運行后回傳了增加的出列計數屬性。
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?
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.
uj5u.com熱心網友回復:
為什么第一步會使訊息出隊?它不會只是檢查是否存在任何訊息而不拉動它們嗎?如果是第 2 步將其拉出,那么為什么我在 OUTPUT 中看不到任何訊息?
觸發器當佇列中有訊息時(V2)回傳佇列中存在的訊息以及您無法看到正在運行的訊息的原因Get Messages。
根據您的要求,您可以在每次將訊息推送到佇列時觸發時使用Message Textof連接器。When there are messages in a queue (V2)
注意:此流程會針對佇列中的每條訊息觸發,并將訊息多次發送到您的 API 端點。

如何正確處理我的佇列訊息?我想分批提取 32 個(這是最大數量)并在 For each 回圈中處理它們。
而如果您想將它們作為一批 32 獲取,那么您可以使用除When there are messages in a queue (V2)然后使用Get Messages操作之外的任何觸發器。
如果您僅限于使用 Storage Queue Connector,那么您可以使用When a specified number of messages are in a given queue (V2),否則一個簡單的 HTTP 觸發器就足以觸發邏輯應用程式。


結果:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/452536.html
標籤:azure azure-logic-apps azure-storage-queues
