static string GetCorrelationId(Message message, Dictionary<string, string> headers)
{
string correlationId;
if (headers.TryGetValue(Headers.CorrelationId, out correlationId))
{
return correlationId;
}
if (message.CorrelationId == "00000000-0000-0000-0000-000000000000\\0")
{
return null;
}
//msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end that the sender added to make it compatible
//The replace can be removed in v5 since only v3 messages will need this
return message.CorrelationId.Replace("\\0", string.Empty);
}