locked
Correlation Sets RRS feed

  • Question

  • hi I have a doubt regarding how Correlation works in BizTalk server..I want know how biztalk internally know which message is related to which instance .As example if we receive response in 2 days.we dropped a message which  calls a wcf service and gets the response.by mistake i dropped the same message 2 times how biztalk will know which response is related to which instance of the orchestration because in this case it will have same correlation type and same message type???
    Sunday, October 13, 2013 2:42 PM

Answers

  • The Correlation Type defines what combination of values to correlate, or match, on.

    At runtime though, it's basically by a specific value, or set of values, that BizTalk routes a message back to a waiting Orchestration.

    If you have a Correlation Set with one property, MyCP.MyValue, and you Initialize MyCP.MyValue to '12345', BizTalk will create a subscription for the following Receive Port on exactly that, MyCP.MyValue = '12345'.

    If you send a message twice that satisfies MyCP.MyValue = '12345', the first will be routed back to the waiting Orchestration.  The second will likely generate a No Subscriber error because the Instance Subscription for MyCP.MyValue = '12345' has already been satisfied by the first message.

    If you walk through the tutorial, it will show how to set the correlation values: http://msdn.microsoft.com/en-us/library/aa577612(v=bts.20).aspx

    Sunday, October 13, 2013 3:24 PM
    Moderator

All replies

  • The Correlation Type defines what combination of values to correlate, or match, on.

    At runtime though, it's basically by a specific value, or set of values, that BizTalk routes a message back to a waiting Orchestration.

    If you have a Correlation Set with one property, MyCP.MyValue, and you Initialize MyCP.MyValue to '12345', BizTalk will create a subscription for the following Receive Port on exactly that, MyCP.MyValue = '12345'.

    If you send a message twice that satisfies MyCP.MyValue = '12345', the first will be routed back to the waiting Orchestration.  The second will likely generate a No Subscriber error because the Instance Subscription for MyCP.MyValue = '12345' has already been satisfied by the first message.

    If you walk through the tutorial, it will show how to set the correlation values: http://msdn.microsoft.com/en-us/library/aa577612(v=bts.20).aspx

    Sunday, October 13, 2013 3:24 PM
    Moderator
  • The correlation creates a subscription same as for others but with a difference.

    For regular messages the subscription is of type <namespace>#<schema root>

    For autocorrelated messages the subscription is of type <namespace>#<schema root>#<internal correlation id>

    When you create a correlation set the subscription create is of the type

    <namespace>#<schema root>#correlation property 1+correlation property 2+.......

    So if you drop two identical messages, both will match the same correlation set (NOT the auto correlation) so the WCF service will get called TWICE. But say if had a process which wrote to a queue based on the correlation set and waited on another queue, for the same message [if you;re using properties from the message] you'd end up with TWO identical subscriptions which will be fulfilled on the first response and the for the second you;d get a "Subscriber not found".

    Regards.

    Monday, October 14, 2013 3:47 AM