Implementing Singleton pattern with BizTalk Orchestrations

With BizTalk Orchestrations, a new instance of the orchestration is created every time a new message arrives at the Receive Port. In a Singleton pattern only one instance should exist to handle all the messages (or events) in the system.  You can implement the singleton pattern using a simple correlation on the Receive Port name, as in figure.

 

Then in your orchestration you have two receive shapes, one to activate the orchestration, and the other inside an infinite loop (or you can put some condition on the loop so you can exit he orchestration on will, which is a good idea) that correlates to the receive port Name as in figure

 

That is all that is to it! Enjoy

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s