How work Request-Response Pattern (Part 3)

 

In this part, we will see if it is possible to use a Two-way port with an orchestration that use only one-way logical port and correlation.

If we create a two-way port (WCF-HttpBinding for example) with the 2nd orchestration of previous part, we can see that a new dynamic correlation is created when the message is processing by the two-way port

 

image

 

The properties used are :

  • system-properties.EpmRRCorrelationToken
  • system-properties.RouteDirectToTP

 

We do the same as in part 2 , ie: use a correlation type and a correlation set on this two property and set the property like this :

msgResponse(BTS.CorrelationToken) =  msgRequest(BTS.CorrelationToken);
msgResponse(BTS.EpmRRCorrelationToken) =msgRequest(BTS.EpmRRCorrelationToken);
msgResponse(BTS.RouteDirectToTP)= true;

we can see the following error :

Event Type:    Error
Event Source:    BizTalk Server 2009
Event Category:    BizTalk Server 2009
Event ID:    5813
Date:        09/02/2010
Time:        14:26:32
User:        N/A
Computer:    BTS06R2
Description:
A response message for two-way receive port "ReceiveWCF" is being suspended as the messaging engine could not correlate the response to an existing request message. This usually happens when the host process has been recycled.
MessageId:  {8937BA98-A53A-488B-A239-B3C2895E0737}
InstanceID: {EAA45BB8-513F-4DF1-BE27-CD4ED4E81848}

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

After a small search on google, it seems I apparently forget to write some internal properties that BizTalk Messaging Engine used for request response correlation.

So in my expression shape :

msgResponse(BTS.ReqRespTransmitPipelineID)=msgRequest(BTS.ReqRespTransmitPipelineID);
msgResponse(BTS.CorrelationToken) =  msgRequest(BTS.CorrelationToken);
msgResponse(BTS.EpmRRCorrelationToken) =msgRequest(BTS.EpmRRCorrelationToken);
msgResponse(BTS.RouteDirectToTP)= true;
msgResponse(BTS.IsRequestResponse) = true;

and I update also the Correlation Type to use these properties : BTS.CorrelationToken,BTS.EpmRRCorrelationToken,BTS.IsRequestResponse,BTS.ReqRespTransmitPipelineID,BTS.RouteDirectToTP

These properties are explains on these sites :

http://geekswithblogs.net/BVeldhoen/archive/2008/08/20/messaging-only-request-response-correlation.aspx

and on this excellent post of Paolo Salvatori to transform a syncrhonous to an asynchronous flows without an orchestrations :

http://blogs.msdn.com/paolos/archive/2008/07/21/msdn-blogs.aspx

 

Conclusion :

With this technique, you could easily couple a synchronous Request Response Port with 2 Asynchronous One-Way Port and use a direct-bindings with the MessageBox

This entry was posted in BizTalk. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s