Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Orchestrations - Configuring Parallel Convoys

4/12/2011 6:23:58 PM

1. Problem

You are implementing a data aggregation integration point, which requires data to be retrieved from multiple systems. Each source system publishes messages, and a message from each system must be received before further processing can take place.

2. Solution

A parallel convoy is a business process (orchestration) that receives multiple messages in parallel (at the same time) that relate to each other. Parallel convoys handle the race condition that occurs as BizTalk attempts to process subscriptions for messages received at the same time.

A common scenario requiring parallel convoys is where multiple messages for a specific event must be received before a business process can start. As an example, suppose your company's policy allows an order to be shipped only once payment has been approved and stock level has been verified. Payment approval comes from a financial system, and stock-level information comes from an inventory system. Once both systems publish their respective messages for a specific order, that order can be delivered to the customer.

Parallel convoys are implemented by message correlation and Parallel Action shapes in BizTalk Server, as shown in the following steps.

  1. Open the project that contains the schemas. (We assume that XSD schemas used to define payment approval and stock-level verification messages are already created.)

  2. Add a new orchestration to the project, and give it a descriptive name. In our example, the orchestration is named ParallelConvoyOrchestration.

  3. Create two new messages, and specify the name and type of each. In our example, we create messages named PaymentApprovalMessage and StockLevelConfirmationMessage, which are defined by the PaymentApprovalSchema and StockLevelConfirmationSchema schemas, respectively.

  4. In the Orchestration View window, expand the Types node of the tree view so that the Correlation Types folder is visible.

  5. Right-click the Correlation Types folder, and select New Correlation Type, which creates a correlation type and launches the Correlation Properties dialog box.

  6. In the Correlation Properties dialog box, select the properties that the correlation will be based on. In our scenario, we select the OrderID property, which has been promoted from the PaymentApprovalSchema and StockLevelConfirmationSchema schemas.

  7. Click the new correlation type, and give it a descriptive name in the Properties window. In our example, the correlation type is named OrderIDCorrelationType.

  8. In the Orchestration View window, right-click the Correlation Set folder, select New Correlation Set, and specify a name and correlation type. In our example, we create a correlation set named OrderIDCorrelationSet and select OrderIDCorrelationType.

  9. From the toolbox, drag the following onto the design surface in top-down order; the parallel convoy configuration is shown in Figure 1:

    • Parallel Actions shape to receive the response from the financial and inventory systems.

    • Receive shape to receive messages from the financial system. Place this shape on the left-hand branch of the Parallel Actions shape. Configure this shape to use the PaymentApprovalMessage, to initialize the OrderIDCorrelationSet, to activate the orchestration, and to use an orchestration receive port.

    • Receive shape to receive messages from the inventory system. Place this shape on the right-hand branch of the Parallel Actions shape. Configure this shape to use the StockLevelConfirmationMessage, to initialize the OrderIDCorrelationSet, to activate the orchestration, and to use an orchestration receive port.

    • Expression shape to deliver the ship the order. Configure this shape to send the order to the appropriate recipient. In our solution, we simply write a message to the trace log via the following code:

      System.Diagnostics.Trace.Write("Shipping Order with ID = " +
      PaymentApprovalMessage
      (ParallelConvoyOrchestration.PropertySchema.OrderID));

Figure 1. Configuring a parallel convoy

3. How It Works

In this solution, we show how a convoy can be used to concurrently handle messages within an orchestration. The parallel convoy, also referred to as a concurrent convoy, consists of the OrderIDCorrelationSet and the Parallel Actions shape. Each Receive shape in the Parallel Actions shape initializes the correlation set, which is based on the order ID. Initializing a correlation set instructs BizTalk Server to associate the correlation type data with the orchestration instance. This allows BizTalk to route all messages that have identical correlation type criteria (in our case, all messages with a specific order ID) to the same instance.

Each of the Receive shapes has its Activate property set to True and its Initializing Correlation configured to the same correlation set. The Receive shape that receives the first message will handle the activation of the orchestration instance and the initializing of the correlation set. The second Receive shape will not activate a new orchestration instance (even though its Activate property is set to True) and will actually follow the correlation set that the other Receive shape initialized.

Based on this example, messages for two order IDs would be handled in the following manner:

  1. A payment approval message for order ID 1 is received, which instantiates orchestration instance 1.

  2. A stock-level confirmation message for order ID 2 is received, which instantiates orchestration instance 2.

  3. A payment approval message for order ID 2 is received, which is correlated and delivered to orchestration 2. The orchestration continues processing, ships order ID 2, and terminates successfully.

  4. A stock-level confirmation message for order ID 1 is received, which is correlated and delivered to orchestration 1. The orchestration continues processing, ships order ID 1, and terminates successfully.

While our example used only a single correlation set, multiple correlation sets can be used to implement a parallel convoy. Parallel convoys are defined as having a convoy set that is initialized on multiple branches of a Parallel Actions shape within an orchestration. Regardless of how many correlation sets are used, if multiple Receive shapes initialize a convoy set in a Parallel Actions shape, the same correlation sets must be initialized on all of the Receive shapes.
Other -----------------
- BizTalk 2010 Recipes : Orchestrations - Maintaining Message Order
- Windows Server 2008 Server Core : Working with Performance Information (part 3)
- Windows Server 2008 Server Core : Working with Performance Information (part 2)
- Windows Server 2008 Server Core : Working with Performance Information (part 1) - Managing Performance Logs and Alerts with the LogMan Utility
- Windows Server 2008 R2 : Overview of Failover Clusters
- Windows Server 2008 R2 Clustering Technologies
- Building Fault-Tolerant Windows Server 2008 R2 Systems
- SharePoint 2010 PerformancePoint Services : Creating Dashboards in the Browser
- SharePoint 2010 PerformancePoint Services : Dashboards in Dashboard Designer (part 4) - Using the TheGreenOrange Data Source Option
- SharePoint 2010 PerformancePoint Services : Dashboards in Dashboard Designer (part 3) - Working with Filters on Dashboards
 
 
Top 10 video Game
-   Minecraft Mods - MAD PACK #10 'NETHER DOOM!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #9 'KING SLIME!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #2 'LAVA LOBBERS!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #3 'OBSIDIAN LONGSWORD!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Total War: Warhammer [PC] Demigryph Trailer
-   Minecraft | MINIONS MOVIE MOD! (Despicable Me, Minions Movie)
-   Minecraft | Crazy Craft 3.0 - Ep 3! "TITANS ATTACK"
-   Minecraft | Crazy Craft 3.0 - Ep 2! "THIEVING FROM THE CRAZIES"
-   Minecraft | MORPH HIDE AND SEEK - Minions Despicable Me Mod
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 92 "IS JOE DEAD?!"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 93 "JEDI STRIKE BACK"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 94 "TATOOINE PLANET DESTRUCTION"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 95 "TATOOINE CAPTIVES"
-   Hitman [PS4/XOne/PC] Alpha Gameplay Trailer
-   Satellite Reign [PC] Release Date Trailer
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
PS4 game trailer XBox One game trailer
WiiU game trailer 3ds game trailer
Trailer game
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer