locked
Timeout a correlation set. RRS feed

  • Question

  • Hi,

    I have a scenario,

    If I initialize a correlation set, say, on a receive port and if the message that needs to follow that correlation doesn't reach in a certain specified time period then that correlation set should be expired and the new message should create a new correlation set rather than following the old correlation. How can that be achieved?

    Thanks.


    Kunal G

    Sunday, December 2, 2012 6:03 PM

Answers

  • Hi Kunal,

    You should have two receive shapes one active at the beginning. Here you should initialize the correlation set. The next receive shape (non active) should be inside the listen shape (as you have shown above).

    Also you should be employing one of the following convoy patterns based on your requirement

    • Sequential Uniform Convoy (to process same message types in order)
    • Sequential Non Uniform Convoy (to process different message types in order)

    There is Parallel Convoy as well but you cannot employ timeout in this case.

    If you are still not clear, please elaborate your requirement so that I can help.


    Thanks, mm2709

    Monday, December 3, 2012 2:25 PM
  • An activatable receive shape activates an instance of the orchestration. There is nothing running and waiting which would time out... so whenever an event (in this publishing of a message that matches the schema published on the orchestration logical shape) occurs, BizTalk creates (activate) an instance of the orchestration to handle the published message. If at the same time TWO messages arrive, then BizTalk creates TWO instances of the orchestration.

    I assumed that after activation (already got the first message), there was a possibility of getting another part of the message and you need to start processing only when you;ve got both the messages. This is a standard pattern (convoy) that can be implemented.

    Regards.

    Monday, December 3, 2012 3:03 PM

All replies

  • You can achieve this by using Listen and Delay shapes in your Orchestration

    Morten la Cour

    • Proposed as answer by Jean-Paul Smit Sunday, December 2, 2012 10:24 PM
    Sunday, December 2, 2012 7:24 PM
  • Could you please elaborate.

    Thanks for the response.


    Kunal G

    Monday, December 3, 2012 7:00 AM
  • Correlation Sets are not events which can be timed out. Correlation Sets help you deliver messages to the originating processing context. So if my understanding is correct, you have a process that receives a message (this initializes the correlation set) and you want to wait for another message which may/may not get delivered within a specified amount of time using the same correlation set. Does the second message come over the same receive location as the first message or is it a different receive location?

    As suggested by la Cour, you should create a parallel shape in your orchestration which has two shapes, one is the receive (following the initialized correlation set) and the second would be a delay shape (timer set to how long you want to wait for the message). The orchestration will thus wait for either the receive or the timer to complete and then proceed. This will help you achieve what you want.

    However, what will happen if the message gets delivered after the timer expires? If the orchestration is active you will get a suspended message (subscriber not found) which will have to be administered operationally.

    Regards.

    Monday, December 3, 2012 7:17 AM
  • I tried putting Activate receive and Delay shape in Listen and parallel Shapes:

    1. If in a Listen shape, I put a Activate receive and Delay shape.

    I get the error: a listen with an activatable receive cannot have a timeout

    2. If in a parallel shape, I put Receive and Delay,

    I get error: if a parallel has an activatable receive then all its' tasks must be activatable

    Is that what you meant? What am I doing wrong here?


    Kunal G

    Monday, December 3, 2012 12:11 PM
  • Hi Kunal,

    You should have two receive shapes one active at the beginning. Here you should initialize the correlation set. The next receive shape (non active) should be inside the listen shape (as you have shown above).

    Also you should be employing one of the following convoy patterns based on your requirement

    • Sequential Uniform Convoy (to process same message types in order)
    • Sequential Non Uniform Convoy (to process different message types in order)

    There is Parallel Convoy as well but you cannot employ timeout in this case.

    If you are still not clear, please elaborate your requirement so that I can help.


    Thanks, mm2709

    Monday, December 3, 2012 2:25 PM
  • An activatable receive shape activates an instance of the orchestration. There is nothing running and waiting which would time out... so whenever an event (in this publishing of a message that matches the schema published on the orchestration logical shape) occurs, BizTalk creates (activate) an instance of the orchestration to handle the published message. If at the same time TWO messages arrive, then BizTalk creates TWO instances of the orchestration.

    I assumed that after activation (already got the first message), there was a possibility of getting another part of the message and you need to start processing only when you;ve got both the messages. This is a standard pattern (convoy) that can be implemented.

    Regards.

    Monday, December 3, 2012 3:03 PM