Reputation: 236
I have a Logic App polling a servicebus queue. With concurrency-control on the Logic App I've limited it to max 5 concurrent instances. I use the trigger "When a message is received in a queue (auto-complete)"
When putting, for example, 8 messages on the queue, it processes 5, then after the polling interval expires (5min) it processes 4... I notice there is one message that's processed for the second time (DeliveryCount = 2). The first Logic App instance for that message didn't throw an error and completed after 20 seconds.
I tried raising the lock timeout to 5 minutes, but no change in behaviour. I would also expect the auto-complete trigger to immediatly complete the message anyway, so I don't think the lock is expired.
I tried lowering the Max Delivery Count to 1.. but then my message gets deadlettered (even if the first try succesfully completed). DeadletterError was "Message could not be consumed after 1 delivery attempts."
I can reproduce this, every time, there's one random message that is processed twice. If I throw more messages in the queue the number of duplicates increases.
I see this behaviour on multiple queues with different Logic Apps.
Logic App specs:
Queue specs:
Any tips are most welcome! Thanks in advance!
Upvotes: 8
Views: 1411
Reputation: 206
If the logic app processes the messages in a time > lock period, the next run will pick up the same message(s). So you might want to check on that.
One approach could be to delete the message just after reading in the logic app. If logic app fails put that message in a dead letter queue.
Upvotes: 1