Saturday, January 12, 2013

Parallel Convoy in BizTalk example

What is Parallel convoy ?

Parallel convoy in BizTalk is used to receive messages in any order. The Orchestration process does not start its execution further until all the messages in parallel convoys are received. In Parallel convoy we have a parallel shape as the first shape in the Orchestration and multiple receive shapes for receiving multiple messages.
                        For example if there is a Online shopping portal which sends several messages to BizTalk like ShoppingDetails, CustomerDetails, BillingAddress and they all need to be received in BizTalk and then only process should continue further and these messages can be receied in any order into BizTalk. This situation can be implemented using Parallel convoy :

SourceSchema for ShoppingDetails message:

SourceSchema1 for BillingAddress messages:

SourceSchema2 for CustomerDetails message:

NOTE : CustID is promoted in all the three schema's. Here is Property schema for CustID :

PropertSchema for CustID:

DestinationSchema :

Orchestration :

In Orchestration we have a Parallel shape with three receive branches and three receive ports for receiving three different types of messages. Now for parallel convoy we have to create Correlation set and correlation type which is done on CustID. All three receive shapes initialize the correlation set because any message can arrive at an time. Suppose 2nd parallel branch's message arrives then the 2nd receive shape initializes the correlation set and the other two follows the correlation set. When all the three messages arrives then only further execution of the Orchestration takes place.