How to set up Correlation Sets in BizTalk 2010

November 25, 2011 at 4:16 pm Leave a comment

Yesterday a friend of mine called me asking for assistance with an orchestration she had set up to properly process suspended messages.

The purpose of my friend’s application was to pick up messages that have failed to to process by certain ports configured to “Enable routing for failed messages”


The main orchestration was configured to pickup messages in which the ErrorReport.FailureCode property exists. This property is automatically filled by BizTalk when a message fails to be processed because reasons like:

0xc0c01657 = Failure in recieve pipeline
0xc0c01658 = Failure in Send Pipeline
0xc0c0167a = Transmission Failure (e.g. endpoint down)



Everything worked ok with the application when a message was sent to any of the ports marked as specified and failed to be processed.

After this early success she tried to modify another BizTalk application  so it could manually suspend error messages and submit them as the ports did.


She modified the outgoing Message (the one to be manually suspended) and set the ErrorReport.FailureCode property to "0xc0c0167a", the same value as a Transmission Failure error.


But the Suspended Messages Orchestration wouldn’t pick this messages up from the Message Box and the following error would be recorded in Windows Application Log:

Event Type:    Error
Event Source:    XLANG/s
Event Category:    None
Event ID:    10008
Date:        11/25/2011
Time:        11:53:32 AM
User:        N/A
An unrecoverable exception (see the ‘inner exception’ below) has occurred.
Exception occurred when persisting state to the database.
Exception type: PersistenceException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void Commit()
        A batch item failed persistence Item-ID 2dd47903-c693-4d12-a49b-7ee8f68538ee OperationType MAIO_CommitBatch Status -1061151998 ErrorInfo The published message could not be routed because no subscribers were found. .
Exception type: PersistenceItemException
Additional error information: Failed to publish (send) a message in the batch. This is usually because there is no one expecting to receive this message.  The error was The published message could not be routed because no subscribers were found.  with status -1061151998.
Exception type: PublishMessageException

As you can see the Message was being correctly published to the Message Box but no subscriber could be found for it so an XLANG exception was raised.

My friend couldn’t understand why the Suspended Messages orchestration wasn’t picking up the message even when its ErrorReport.FailureCode was properly set and she was about to call MSFT and fill a ticket with the CSS Team.

I was sure something was wrong with the correlation set defined for the message so I asked her to let me take a look to the BizTalk application she had modified. as it turn out I was right, there wasn’t a Correlation Set defined to correctly promote the ErrorReport.FailureCode so the Suspended messages orchestration port could identify and pick up the messages.

Correlation is the process of matching an incoming message with the appropriate instance of an orchestration. You must use correlation whenever your orchestration does not have an explicit way of associating a message with an instance, such as an activate receive, a request-response, or a self-correlating port.

To correctly achieve the correlation of messages with orchestration instances you need to define correlation sets. A correlation set is a set of properties with specific values. This is different from a correlation type, which is simply a list of properties. If an incoming message does not have all of these properties, with matching values for each, correlation will fail and the message will not be received by the orchestration instance.

So in order to fix my friend’s orchestration I only needed to perform these additional steps:

1) Define a new Correlation Type


2) Add the ErrorReport.FailureCode to the list of properties to correlate


3) Write down a meaningful name for the Correlation Type just created



4) Define a new Correlation Set


5) Assign the Correlation Type created before to the new Correlation Set. Define a proper message for the later.


6)  Assign the newly created Correlation Set as the Initializing Correlation Set of the outgoing port of the Suspended Messages orchestration



With this simple steps you make sure the ErrorReport.FailureCode in the Message is properly promoted and in consequence correctly identified for Message subscription.

If you want to learn more about Correlations in BizTalk visit the following MSDN article:

Correlation Sets


Entry filed under: BizTalk. Tags: , .

Configure an HTTP Receive Location in BizTalk 2009 User Agent definition when consuming web services using HTTP in BizTalk 2010

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

November 2011
« Oct   Jan »


%d bloggers like this: