'Service bus queue connector in Logic app is not setting message to complete in first recurrence interval which is causing duplicates
Here are the details of logic app
- When a message is received in a queue (auto-complete) Servicebusconnector with recurrence interval of 30 minutes with concurrency control of 20 receives message from service bus queue.
- Lock duration is set to 5 minutes.
- Sends the message to SFTP location using sftpConnector
Problem: The last message in first recurrence interval is not being set as complete and the same message is showing up in second recurrence with Deliverycount 2
Not sure what is causing this as there is lot of time difference in runs.
Solution 1:[1]
The auto-complete trigger completes a message automatically, but only when the next call to Service Bus is made. This behaviour may have an impact on the design of your logic app.
For more information, please refer this document.
Solution 2:[2]
We were able to fix this issue by reducing the recurrence interval to less than service bus queue's lock duration based on Microsoft's documentation.
The auto-complete trigger automatically completes a message, but completion happens only at the next call to Service Bus. This behavior can affect your logic app's design. For example, avoid changing the concurrency on the auto-complete trigger because this change might result in duplicate messages if your logic app workflow enters a throttled state. Changing the concurrency control creates these conditions: throttled triggers are skipped with the WorkflowRunInProgress code, the completion operation won't happen, and next trigger run occurs after the polling interval. You have to set the service bus lock duration to a value that's longer than the polling interval. However, despite this setting, the message still might not complete if your logic app workflow remains in a throttled state at next polling interval.
https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-servicebus Exchange messages with Azure Service Bus - Azure Logic Apps Create automated tasks and workflows that send and receive messages by using Azure Service Bus in Azure Logic Apps
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | SuryasriKamini-MT |
| Solution 2 | Techstack |
