javros
javros

Reputation: 823

Correlation in BizTalk

I have 2 orchestrations in my project and 2 schemas (the first is for request, the second is for response). Orchestration 1 has a Receive shape (Activating=true). It receives a request and then routes it to Orchestration 2. The latter constructs a request to a web service, which responds with a response, waits 2 min and then sends a new request to my BizTalk service. Both projects use the same schemas, a Request and a Response schemas.

Orchestration 2 uses a correlation set which is initialized in a Send shape that sends a request to the web service. Also, Orchestration 2 has a Receive shape waiting for a message with the correlation set previously in the Send shape.

Here is the sequence diagram: enter image description here

And there is the Orchestration 2: enter image description here

Send_1 and Receive_2 shapes have correlation properties set up.

The problem is when a webservice sends request2 (see the diagram above) to my biztalk service, it throws an error saying "The message found multiple request response subscriptions. A message can only be routed to a single request response subscription." How that can be if I've set the correlation? I expected request2 to be routed to the Orchestration 2 because it has a receiver with correlation.

Upvotes: 2

Views: 2082

Answers (1)

Maxime Labelle
Maxime Labelle

Reputation: 3639

The error message is correct.

When a Request is sent from the WebService, it is routed to the Activation Receive Shape of Orchestration2.

But because the correlation is in effect, this creates an additional subscription which is why the request is also expected to be routed to the third Receive shape in Orchestration2.

If you cannot distinguish the Request schemas, you must use an additionnal condition for activating Orchestration2. You can, for instance, filter the Request that comes from the Orchestration1 with extra filters based upon context properties.

You'll observe that one Request comes from an WCF or SOAP Adapter while the first one does not.

Upvotes: 3

Related Questions