Search code examples
biztalkbiztalk-2013biztalk-orchestrations

Preventing Dehydrated instances when using Parallel Convoy Correlation and messages are missing


I have an orchestration that gets activated by 1 of 2 types of messages coming in on a parallel shape. The messages are correlated by ID and status and then the remainder of the orchestration gets executed (and the messages get combined into 1).

enter image description here

I would like to devise a way to prevent dehydrated instances of the orchestrations from happening when one of the 2 messages does not come through. So basically, 1 message comes in and the other doesn't, the orchestration instance gets dehydrated while waiting for the second message.

I've been doing a bunch of searching and found a few decent ways to do it if this was serial convoy, but it's not and the order of the messages cannot be guaranteed.

For example, this post is very helpful in terms of serial convoys, but still does not satisfy my requirements.

I tried using a listen shape with each of the messages on its own branch and a delay on the third branch, but learned that if you are activating with a listen, all branches must activate and since the delay shape cannot activate an orchestration, it will not compile.

Any suggestions, or should I just give up and go for making a separate database in order to correlate the messages manually using pipelines?


Solution

  • Based on your description, the title of your message is slightly inaccurate. Dehydration is not the problem, the missing message is.

    What you need to do is wrap the Receives in a Scope Shape with a Timeout set. Then, if the other Message does not arrive within the Timeout, a Timeout Exception will be raised, which you can handle and take the appropriate action.

    Otherwise, the Parallel Shape will essentially wait forever for the other Message.