This sample demonstrates how the messaging activities (Send, Receive, SendReply, and ReceiveReply) can be used with multiple content-based correlations.and content-based correlation. In this scenario, a correlation is first initialized based on a purchase order ID, and then another correlation is created later based on the customer ID. This shows how a Receive activity can both follow an existing correlation and initialize a new correlation based on the same incoming message.
Messaging activities and content-based correlation
This sample shows how to use multiple content-based correlations. In this scenario, a correlation is first initialized based on a purchase order ID, and then another correlation is created later based on the customer ID. The correlations are cascaded using a Receive activity that both follows an existing correlation (PurchaseOrderId) and initializes a new correlation (CustomerId) based on the same incoming message. To accomplish this, the Receive activity uses the CorrelatesOn, CorrelatesWith and CorrelationInitializers properties.
To use this sample
Open Visual Studio 2010 with elevated permissions, by right-clicking the Visual Studio 2010 icon and selecting Run as administrator.
Using Visual Studio 2010, open the CascadingCorrelation.sln solution file.
To build the solution, press CTRL+SHIFT+B.
To run the server, press F5.
Once the service is ready and listening for messages, in Solution Explorer, right-click the Client project and run it.
The samples may already be installed on your machine. Check for the following (default) directory before continuing.