Thursday, August 6, 2009

Dealing with a Convoy in BizTalk

Biztalk is a messaging system which is based on traditional publish and subscribe approach. In few circumstances, we need to process messages in a way that the above approach cannot handle. To meet these special business requirements, convoys comes into the picture.

• Sequential convoy - Items that are in a order, one after another for example item 1 will finish and then item 2 will start and when it will finish item 3 will start. Once all completed an action will take place.
• Parallel convoy - Items that are in any order, but must all be present before something occurs. In this case all actions item 1, item 2 and item 3 will be processed parallely independently but once we get responses of all(the order doesnot matter),an action will take place.

Consideration for using convoy processing with a business process involves following these rules:
• The correlation set used on the Receive shapes may not contain more than three properties used for correlation. A correlation set is a list of properties with specific values that you use to route messages a specific business process. This is because these values identify and store at the database level. This has support for a maximum of three parameters.
• Parallel and sequential convoy may coexist in the same business process, but they may not share any correlation sets with each other. This is because each correlation set may only belong to one convoy.
• BizTalk Server 2004 does not support convoy processing when passing in an already initialized correlation set into a new orchestration using the start orchestration. This is because convoy sets handle at the database level, independent of already running orchestration instances.
Parallel Convoy is nothing but parallel shape with receive. So follwing rules applies to that:

a. If one of the tasks of a parallel activation has an active Receive as the first shape, all of the tasks of that parallel activation must have an active Receive as the first shape, and all of those Receive shapes must initialize at least one correlation.
b. If a particular correlation is initialized on more than one task of a parallel activation by a Receive shape, each of the concerned activating Receive shapes must initialize exactly the same correlation.

Sequential receive convoys can be additionally broken down into two sub-categories:
• Uniform sequential receive convoys
• Non-uniform sequential receive convoys

Uniform sequential receive message processing exists when many instances of a message is received and all must be handled by the same business process as in case of FILE Adapter if we want FIFO mechanism.

Non-Uniform Sequential Receives
In the non-uniform sequential receive design pattern, the receipt of two or more different types of messages occurs in a known order before the rest of the business process can continue. Definition of the order of the received messages occurs inside the business process, although BizTalk Server 2004 does not enforce the order other than for the first message.

Note: Convoys have the drawbacks of bottlenecks and zombies. So it should be only used when there is such a business requirement.

No comments:

Post a Comment