One of the common design patterns in enterprise integration is processing transactions in Sequence. We are pretty much aware of how to implement sequential convoy in BizTalk which behind the scenes gets controlled and managed by BizTalk SQL Db's to serve sequence mechanism.
Similarly, we could use Azure enterprise messaging service - Service Bus to leverage this mechanism using Logic App workflow.
In this blog, we will implement sequential convoy with Service Bus Queue. The same can be replicated with Topic - Subscription as well.
Service Bus namespace with Queue enabled for sessions - In service Bus , sessions guarantee that the messages will be delivered in order how they received in Queue/Topic Subscriptions. Of course , you might have seen the conventional queue itself serving messages in an order without sessions but it's not guaranteed the FIFO, as messages will be assigned to messaging brokers in Service Bus in round Robbin fashion while receiving.
Logic App Workflow definition:
Challenges in real-time: As we are using peek lock mode , the message will be locked till message lock duration time set on the Queue/topic subscription which can be maximum of 5 minutes. When it exceeds this time duration, the lock will be lost on the message and results in duplicate message processing. However, this can be addressed if end system has the duplicate handling mechanism.
So this is quite possible, in real-time integrations message processing may take more than the lock duration time and cause failures while completing a message. In order to handle this, we can use renew message lock pattern to renew the lock before it expires to support the additional time to process message without loosing the lock on message.
We have two actions in service bus to renew the message lock.
If we need to implement extensive renew lock pattern where we are not sure how much time the message processing takes and need an auto renew lock mechanism. You could check below workflow which has an extension to the implementation above controlled by variables on auto renew lock.
You may need to implement the exception handling like dead-lettering the messaging on top of this Logic App.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.