duplicate runs with built in service bus trigger in logic apps standard workflows

61 Views Asked by At

We are seeing the workflow duplicate runs on a single message from queue with sessions enabled. I have posted the same on MS blog and no replies there hence posting incase if anyone is also facing the same issue. Copied from MS blog.

https://techcommunity.microsoft.com/t5/azure-integration-services-blog/concurrency-support-for-service-bus-built-in-connector-in-logic/ba-p/4036530

We are using stateful logic apps standard workflows in ASE environment with the trigger "On single new message from queue session" and seeing some unexpected behaviors. Can you please clarify on the below items?

  1. We can see concurrency option under trigger settings. So is this concurrency for multiple sessions or for a single session? If the queue has 100 different active sessions, then does this settings decides how many different session instances should it run?

  2. We pushed a single message to the session queue and we are seeing our workflow running 3 instances at the same on the same message? If there is one active session in queue, then it is always one instance against a session not multiple right. When we check run history of all the 3 runs picking the single message as sessionid, messageid and sequence number are same for all the 3 runs. it is not happening all the times and it happens randomly.

  3. We assume this trigger works on peak lock mode though it does not mention in the name of the trigger otherwise the complete message should fail but in our case complete message and close session are successful hence we are thinking it is peak lock trigger - please confirm

Our workflow is simple trigger gets a single message, process the message, complete the message and close the session. And also we have increased the lock timeout to 5 minutes so it is not the issue with logic app processing times.

Appreciate your reply.

Thanks

1

There are 1 best solutions below

3
Ikhtesam Afrin On

I have created a Service Bus with session enabled queue in it.

In logic app standard, I am using On single new message from queue session trigger to invoke the logic app upon message arrival in the queue.

  • In my case, my logic app gets trigger only once for every message.

enter image description here

  • You can also try using When messages are available in a queue trigger by selecting the session parameter in the flow, this trigger also worked as expected for me.

enter image description here

  • By enabling the Concurrency Control in the workflow, you are allowing it to run sequentially like if you set the limit to 1 then only one instance will run at a time.

enter image description here

  • There are separate triggers which works on peek-lock basic, I believe the trigger you are using is not working on peek lock mode.

enter image description here