Message Headers

Component: NServiceBus | Nuget: NServiceBus (Version: 6.x)

The headers in a message contain information that is used by the messaging infrastructure to help with the message delivery. Message headers are very similar, in both implementation and usage, to HTTP headers. To learn more about how to use custom headers, see the header manipulation article.

Timestamp format

For all timestamp message headers, the format is yyyy-MM-dd HH:mm:ss:ffffff Z where the time is UTC. The helper class DateTimeExtensions supports converting from UTC to wire format and vice versa by using the ToWireFormattedString() and ToUtcDateTime() methods.

const string Format = "yyyy-MM-dd HH:mm:ss:ffffff Z";

public static string ToWireFormattedString(DateTime dateTime)
{
    return dateTime.ToUniversalTime()
        .ToString(Format, CultureInfo.InvariantCulture);
}

public static DateTime ToUtcDateTime(string wireFormattedString)
{
    return DateTime.ParseExact(wireFormattedString, Format, CultureInfo.InvariantCulture)
       .ToUniversalTime();
}

Serialization Headers

The following headers include information for the receiving endpoint on the message serialization option that was used.

NServiceBus.ContentType

The type of serialization used for the message, for example text/xml or text/json. This header was added in Version 4.0. In some cases, it may be useful to use the NServiceBus.Version header to determine how to use the value in this header appropriately.

NServiceBus.EnclosedMessageTypes

The fully qualified .NET type name of the enclosed message(s). The receiving endpoint will use this type when deserializing an incoming message. Depending on the versioning strategy the type can be specified in the following ways:

  • Full type name: Namespace.ClassName.
  • Assembly qualified name: Namespace.ClassName, AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
In integration scenarios, this header can be safely omitted if the endpoint uses XmlSerialization and the root node happens to be the message type.

Messaging interaction headers

The following headers are used in various ways to enable different messaging interaction patterns such as Request-Response, etc.

NServiceBus.MessageId

A unique ID for the current message.

NServiceBus.CorrelationId

NServiceBus implements the Correlation Identifier pattern by using a Correlation Id header.

Message correlation connects request messages with their corresponding response messages. The Correlation Id of the response message is a Message Id of its corresponding request message.

An example usage of Correlation Identifier within NServiceBus is callbacks.

NServiceBus.ConversationId

Identifier of the conversation that this message is part of. It enables the tracking of message flows that span more than one message exchange. Conversation Id and RelatedTo fields allow ServiceInsight to reconstruct the entire message flow.

The first message that is sent in a new flow is automatically assigned a unique Conversation Id that is then propagated to all the messages that are subsequently sent, thus forming a conversation. Each message that is sent within a conversation also has a RelatedTo value that identifies the originating message that caused it to be sent.

The Conversation Id header can be manipulated to create custom conversations which are meaningful from the domain perspective (e.g. using Order Id as the Conversation Id to track the life cycle of the order).

NServiceBus.RelatedTo

The MessageId that caused this message to be sent.

NServiceBus.MessageIntent

Message intent can have one of the following values:

SendRegular point-to-point send. Note that messages sent to Error queue will also have a Send intent
PublishThe message is an event that has been published and will be sent to all subscribers.
SubscribeA control message indicating that the source endpoint would like to subscribe to a specific message.
UnsubscribeA control message indicating that the source endpoint would like to unsubscribe to a specific message.
ReplyThe message has been initiated by doing a Reply or a Return from within a Handler or a Saga.

NServiceBus.ReplyToAddress

Downstream message Handlers or Sagas use this value as the reply queue address when replying or returning a message.

Send Headers

When a message is sent the headers will be as follows:

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = 7ee9683c-8271-4bc3-a861-a65e00fa43fc\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = b1163c98-7662-40f1-88f3-a65e00fa43fc
NServiceBus.CorrelationId = 7ee9683c-8271-4bc3-a861-a65e00fa43fc
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 7ee9683c-8271-4bc3-a861-a65e00fa43fc
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterSendV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterSendV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:11:343014 Z
NServiceBus.Version = 6.0.0

The above example headers are for a Send and hence the MessageIntent header is Send. If the message was published instead, the MessageIntent header would be Publish.

Reply Headers

When replying to a message:

  • The MessageIntent is Reply.
  • The RelatedTo will be the same as the initiating MessageID.
  • The ConversationId will be the same as the initiating ConversationId.
  • The CorrelationId will be same as the initiating CorrelationId.

Example Reply Headers

Given an initiating message with the following headers:

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = 8d948ad0-dd9a-49c1-a81a-a5eb011ad57e\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 02c44b5d-60bf-4d47-a3e1-a5eb011ad57f
NServiceBus.CorrelationId = 8d948ad0-dd9a-49c1-a81a-a5eb011ad57e
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 8d948ad0-dd9a-49c1-a81a-a5eb011ad57e
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterReplyV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterReplyV6@MACHINENAME
NServiceBus.TimeSent = 2016-04-17 07:09:46:018145 Z
NServiceBus.Version = 6.0.0

The headers of reply message will be as follows:

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = 8d948ad0-dd9a-49c1-a81a-a5eb011ad57e\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 02c44b5d-60bf-4d47-a3e1-a5eb011ad57f
NServiceBus.CorrelationId = 8d948ad0-dd9a-49c1-a81a-a5eb011ad57e
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToReply, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 41ca2306-a586-4961-85ca-a5eb011ad582
NServiceBus.MessageIntent = Reply
NServiceBus.OriginatingEndpoint = HeaderWriterReplyV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.RelatedTo = 8d948ad0-dd9a-49c1-a81a-a5eb011ad57e
NServiceBus.ReplyToAddress = HeaderWriterReplyV6@MACHINENAME
NServiceBus.TimeSent = 2016-04-17 07:09:46:039144 Z
NServiceBus.Version = 6.0.0

Publish Headers

When a message is published the headers will be as follows:

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = 7fb50097-96f0-4649-b266-a65e00fa42c5\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = f8b15766-2706-4858-875a-a65e00fa42c9
NServiceBus.CorrelationId = 7fb50097-96f0-4649-b266-a65e00fa42c5
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToPublish, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 7fb50097-96f0-4649-b266-a65e00fa42c5
NServiceBus.MessageIntent = Publish
NServiceBus.OriginatingEndpoint = HeaderWriterPublishV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterPublishV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:10:318910 Z
NServiceBus.Version = 6.0.0

Return from a Handler

When returning a message instead of replying:

  • The Return has the same points as the Reply example from above with some additions.
  • The ReturnMessage.ErrorCode contains the value that was supplied to the Bus.Return method.

Example Return Headers

Given an initiating message with the following headers:

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = 2d448535-0bb9-49d3-bf91-a5eb011ad637\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = c62f2dc6-8b92-4265-8ecd-a5eb011ad637
NServiceBus.CorrelationId = 2d448535-0bb9-49d3-bf91-a5eb011ad637
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 2d448535-0bb9-49d3-bf91-a5eb011ad637
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterReturnV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterReturnV6@MACHINENAME
NServiceBus.TimeSent = 2016-04-17 07:09:46:633444 Z
NServiceBus.Version = 6.0.0

The headers of reply message will be as follows:

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = 2d448535-0bb9-49d3-bf91-a5eb011ad637\0
NServiceBus.ControlMessage = True
NServiceBus.ConversationId = c62f2dc6-8b92-4265-8ecd-a5eb011ad637
NServiceBus.CorrelationId = 2d448535-0bb9-49d3-bf91-a5eb011ad637
NServiceBus.MessageId = aa408bf4-377d-4fbd-979a-a5eb011ad63a
NServiceBus.MessageIntent = Reply
NServiceBus.OriginatingEndpoint = HeaderWriterReturnV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.RelatedTo = 2d448535-0bb9-49d3-bf91-a5eb011ad637
NServiceBus.ReplyToAddress = HeaderWriterReturnV6@MACHINENAME
NServiceBus.ReturnMessage.ErrorCode = 100
NServiceBus.TimeSent = 2016-04-17 07:09:46:642444 Z
NServiceBus.Version = 6.0.0

Timeout Headers

NServiceBus.ClearTimeouts

A marker header to indicate that the contained control message is requesting that timeouts be cleared for a given saga.

NServiceBus.Timeout.Expire

A timestamp that indicates when a timeout to be fired.

NServiceBus.Timeout.RouteExpiredTimeoutTo

The queue name where a timeout should be routed back to when it fires.

NServiceBus.IsDeferredMessage

A marker header to indicate that this message resulted from a Defer.

Saga Related Headers

When a message is dispatched from within a Saga the message will contain the following:

  • A OriginatingSagaId header which matches the ID used as the index for the Saga Data stored in persistence.
  • A OriginatingSagaType which is the fully qualified type name of the saga that sent the message.

Example "Send from Saga" Headers

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = c5e3d16a-e295-4321-aea7-a5eb011ad6de\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = dbaf0a21-9b6a-49bd-ae76-a5eb011ad6df
NServiceBus.CorrelationId = c5e3d16a-e295-4321-aea7-a5eb011ad6de
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.SendFromSagaMessage, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterSagaV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.OriginatingSagaId = 0511aac4-13d0-44b9-a872-a5eb011ad6e4
NServiceBus.OriginatingSagaType = Core6.Headers.Writers.MyNamespace.Saga1, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.RelatedTo = c5e3d16a-e295-4321-aea7-a5eb011ad6de
NServiceBus.ReplyToAddress = HeaderWriterSagaV6@MACHINENAME
NServiceBus.TimeSent = 2016-04-17 07:09:47:211705 Z
NServiceBus.Version = 6.0.0

Replying to a Saga

A message Reply is performed from a Saga will have the following headers:

  • The send headers are the same as a normal Reply headers with a few additions.
  • Since this reply is from a secondary Saga then OriginatingSagaId and OriginatingSagaType will match the second saga.
  • Since this is a Reply to a the initial Saga then the headers will contain SagaId and SagaType headers that match the initial Saga.

Example "Replying to a Saga" Headers

Via calling Bus.Reply

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = c5e3d16a-e295-4321-aea7-a5eb011ad6de\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = dbaf0a21-9b6a-49bd-ae76-a5eb011ad6df
NServiceBus.CorrelationId = c5e3d16a-e295-4321-aea7-a5eb011ad6de
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.ReplyFromSagaMessage, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 34907d38-48be-46ba-9cc2-a5eb011ad729
NServiceBus.MessageIntent = Reply
NServiceBus.OriginatingEndpoint = HeaderWriterSagaV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.OriginatingSagaId = 25b7653a-5612-4e9e-b78f-a5eb011ad729
NServiceBus.OriginatingSagaType = Core6.Headers.Writers.MyNamespace.Saga2, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.RelatedTo = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5
NServiceBus.ReplyToAddress = HeaderWriterSagaV6@MACHINENAME
NServiceBus.SagaId = 0511aac4-13d0-44b9-a872-a5eb011ad6e4
NServiceBus.SagaType = Core6.Headers.Writers.MyNamespace.Saga1, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.TimeSent = 2016-04-17 07:09:47:441082 Z
NServiceBus.Version = 6.0.0

Via calling Saga.ReplyToOriginator

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = dbaf0a21-9b6a-49bd-ae76-a5eb011ad6df
NServiceBus.CorrelationId = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.ReplyToOriginatorFromSagaMessage, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 818a5545-a038-4138-94c6-a5eb011ad72a
NServiceBus.MessageIntent = Reply
NServiceBus.OriginatingEndpoint = HeaderWriterSagaV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.OriginatingSagaId = 25b7653a-5612-4e9e-b78f-a5eb011ad729
NServiceBus.OriginatingSagaType = Core6.Headers.Writers.MyNamespace.Saga2, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.RelatedTo = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5
NServiceBus.ReplyToAddress = HeaderWriterSagaV6@MACHINENAME
NServiceBus.TimeSent = 2016-04-17 07:09:47:442082 Z
NServiceBus.Version = 6.0.0

Requesting a Timeout from a Saga

When requesting a Timeout from a Saga:

  • The OriginatingSagaId, OriginatingSagaType, SagaId and SagaType will all match the Saga that requested the Timeout.
  • The Timeout.RouteExpiredTimeoutTo header contains the queue name for where the callback for the timeout should be sent.
  • The Timeout.Expire header contains the timestamp for when the timeout should fire.

Example Timeout Headers

Edit
$.diagnostics.originating.hostid = 8cf0a8f78f9cd1885699777c83eb631e
CorrId = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = dbaf0a21-9b6a-49bd-ae76-a5eb011ad6df
NServiceBus.CorrelationId = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.TimeoutFromSaga, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.IsSagaTimeoutMessage = True
NServiceBus.MessageId = 433d5c9f-4968-4bf9-9c7e-a5eb011ad72a
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterSagaV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.OriginatingSagaId = 25b7653a-5612-4e9e-b78f-a5eb011ad729
NServiceBus.OriginatingSagaType = Core6.Headers.Writers.MyNamespace.Saga2, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.RelatedTo = cb4c79a4-476c-4e64-aff1-a5eb011ad6e5
NServiceBus.ReplyToAddress = HeaderWriterSagaV6@MACHINENAME
NServiceBus.SagaId = 25b7653a-5612-4e9e-b78f-a5eb011ad729
NServiceBus.SagaType = Core6.Headers.Writers.MyNamespace.Saga2, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.Timeout.Expire = 2016-04-17 07:09:47:444081 Z
NServiceBus.Timeout.RouteExpiredTimeoutTo = HeaderWriterSagaV6@MACHINENAME
NServiceBus.TimeSent = 2016-04-17 07:09:47:443081 Z
NServiceBus.Version = 6.0.0

Defer a Message

When doing a Defer the message will have similar header to a Send with a few editions:

  • The message will have IsDeferredMessage with the value of true.
  • Since the Defer feature uses the Timeouts feature the Timeout headers will exist.
  • The Timeout.RouteExpiredTimeoutTo header contains the queue name for where the callback for the timeout should be sent.
  • The Timeout.Expire header contains the timestamp for when the timeout should fire.

Example Defer Headers

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = a8ed398a-fdad-4400-933d-a65e00fa3c16\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = b11f0139-242d-4e98-bf33-a65e00fa3c19
NServiceBus.CorrelationId = a8ed398a-fdad-4400-933d-a65e00fa3c16
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = a8ed398a-fdad-4400-933d-a65e00fa3c16
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterDeferV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterDeferV6@MACHINENAME
NServiceBus.Timeout.Expire = 2016-08-10 05:11:04:622206 Z
NServiceBus.Timeout.RouteExpiredTimeoutTo = HeaderWriterDeferV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:04:612709 Z
NServiceBus.Version = 6.0.0

Diagnostic and Informational Headers

Headers used to give visibility into "where", "when" and "by whom" Of a message. Used by ServiceControl, ServiceInsight and ServicePulse.

$.diagnostics

The host details of the endpoint where the message was being processed. This header contains three parts:

  • $.diagnostics.hostdisplayname
  • $.diagnostics.hostid
  • $.diagnostics.originating.hostid

NServiceBus.TimeSent

The timestamp of when the message was sent. Used by the Performance Counters.

NServiceBus.OriginatingEndpoint

The endpoint name where the message was sent from.

NServiceBus.OriginatingMachine

The machine name where the message was sent from.

NServiceBus.Version

The NServiceBus version number.

Audit Headers

Headers added when a message is Audited

NServiceBus.ProcessingEnded

The timestamp processing of a message ended.

NServiceBus.ProcessingEndpoint

Name of the endpoint where the message was processed.

NServiceBus.ProcessingMachine

The machine name of the endpoint where the message was processed.

NServiceBus.ProcessingStarted

The timestamp the processing of this message started.

Example Audit Headers

Given an initiating message with the following headers:

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = 8444b9f9-da4a-4755-84a4-a65e00fa376c\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 557af6a8-b569-4e23-ad32-a65e00fa377f
NServiceBus.CorrelationId = 8444b9f9-da4a-4755-84a4-a65e00fa376c
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 8444b9f9-da4a-4755-84a4-a65e00fa376c
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterAuditV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterAuditV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:00:690401 Z
NServiceBus.Version = 6.0.0

When that message fails to be processed it will be sent to the Error queue with the following headers:

Edit
$.diagnostics.hostdisplayname = MACHINENAME
$.diagnostics.hostid = 554380dd342ba9aa0ca1926e4510b1be
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = 8444b9f9-da4a-4755-84a4-a65e00fa376c\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 557af6a8-b569-4e23-ad32-a65e00fa377f
NServiceBus.CorrelationId = 8444b9f9-da4a-4755-84a4-a65e00fa376c
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 8444b9f9-da4a-4755-84a4-a65e00fa376c
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterAuditV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ProcessingEnded = 2016-08-10 05:11:01:991387 Z
NServiceBus.ProcessingEndpoint = HeaderWriterAuditV6
NServiceBus.ProcessingMachine = MACHINENAME
NServiceBus.ProcessingStarted = 2016-08-10 05:11:01:985899 Z
NServiceBus.ReplyToAddress = HeaderWriterAuditV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:00:690401 Z
NServiceBus.Version = 6.0.0

Retries handling headers

Headers used to facilitate Retries.

These headers will only exist after the initial retry has occurred.

NServiceBus.FailedQ

The queue at which the message processing failed.

NServiceBus.FLRetries

The number of Immediate Retries that has been performed for a message.

NServiceBus.Retries

The number of Delayed Retries that has been performed for a message.

NServiceBus.Retries.Timestamp

A timestamp used by Delayed Retries to determine if the maximum time for retrying has been reached.

Error forwarding headers

When a message handled by recoverability, it will have the following extra headers added to the existing headers. If retries occurred, then those messages will be included with the exception of NServiceBus.Retries, which is removed.

NServiceBus.ExceptionInfo.ExceptionType

The Type.FullName of the Exception. Obtained by calling Exception.GetType().FullName.

NServiceBus.ExceptionInfo.InnerExceptionType

The full Type name of the InnerException if it exists. Obtained by calling Exception.InnerException.GetType().FullName.

NServiceBus.ExceptionInfo.HelpLink

The Exception HelpLink.

NServiceBus.ExceptionInfo.Message

The Exception Message.

NServiceBus.ExceptionInfo.Source

The Exception Source.

NServiceBus.ExceptionInfo.StackTrace

The Exception StackTrace.

Example Error Headers

Given an initiating message with the following headers:

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = b55e0100-acd6-4e27-bc6d-a65e00fa3e3f\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = a8a5d8e7-5117-4104-907c-a65e00fa3e3f
NServiceBus.CorrelationId = b55e0100-acd6-4e27-bc6d-a65e00fa3e3f
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = b55e0100-acd6-4e27-bc6d-a65e00fa3e3f
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterErrorV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterErrorV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:06:447594 Z
NServiceBus.Version = 6.0.0

When that message fails to be processed it will be sent to the Error queue with the following headers:

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = b55e0100-acd6-4e27-bc6d-a65e00fa3e3f\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = a8a5d8e7-5117-4104-907c-a65e00fa3e3f
NServiceBus.CorrelationId = b55e0100-acd6-4e27-bc6d-a65e00fa3e3f
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = b55e0100-acd6-4e27-bc6d-a65e00fa3e3f
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterErrorV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterErrorV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:06:447594 Z
NServiceBus.Version = 6.0.0

Encryption Headers

Headers when using message property encryption.

NServiceBus.RijndaelKeyIdentifier

Identifies which encryption key used for encryption the message property fragments.

Example Headers

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = bc44c387-347f-48e4-8067-a65e00fa3d29\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 7687a2e1-b78e-4b3d-a8af-a65e00fa3d2d
NServiceBus.CorrelationId = bc44c387-347f-48e4-8067-a65e00fa3d29
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = bc44c387-347f-48e4-8067-a65e00fa3d29
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterEncryptionV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterEncryptionV6@MACHINENAME
NServiceBus.RijndaelKeyIdentifier = 2015-10
NServiceBus.TimeSent = 2016-08-10 05:11:05:533155 Z
NServiceBus.Version = 6.0.0

Example Body

Edit
<?xml version="1.0"?><MessageToSend xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.net/Core6.Headers.Writers"><EncryptedProperty1>qae/Imo706tNlXKsSTOMjg==@2q8o+KlSysuF9+1NBONUGw==</EncryptedProperty1><EncryptedProperty2>u6eebnEzuG0bOYZDQk27ew==@h+IBWi2YPFMBoM8eqvt5IA==</EncryptedProperty2></MessageToSend>

FileShare DataBus Headers

When using the FileShare DataBus extra headers and serialized message information is necessary to correlate between the information on the queue and the data on the file system.

When using DataBusProperty

When using the DataBusProperty, NServiceBus uses that property as a placeholder at serialization time. The serialized value of that property will contain a key. This key maps to a named header. That header then provides the path suffix of where that binary data is stored on disk on the file system.

Example Headers

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = 3fd57210-db26-427e-ab20-a65e00fa3b12\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 6d328f28-c35d-41a8-9002-a65e00fa3b14
NServiceBus.CorrelationId = 3fd57210-db26-427e-ab20-a65e00fa3b12
NServiceBus.DataBus.2016-08-10_15\59414869-0377-41ee-9dbb-8ee0db92ed36 = 2016-08-10_15\59414869-0377-41ee-9dbb-8ee0db92ed36
NServiceBus.DataBus.2016-08-10_15\849d42f2-52e1-4ff0-938c-eb2e85f61788 = 2016-08-10_15\849d42f2-52e1-4ff0-938c-eb2e85f61788
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 3fd57210-db26-427e-ab20-a65e00fa3b12
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterDataBusPropertyV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterDataBusPropertyV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:03:741600 Z
NServiceBus.Version = 6.0.0

Example Body

Edit
<?xml version="1.0"?><MessageToSend xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.net/Core6.Headers.Writers"><LargeProperty1><Key>2016-08-10_15\849d42f2-52e1-4ff0-938c-eb2e85f61788</Key><HasValue>true</HasValue></LargeProperty1><LargeProperty2><Key>2016-08-10_15\59414869-0377-41ee-9dbb-8ee0db92ed36</Key><HasValue>true</HasValue></LargeProperty2></MessageToSend>

When using Convention

When using Conventions there is no way to store a correlation value inside the serialized property. Instead, each property has a matching header with the property name used as the header suffix. That header then provides the path suffix of where that binary data is stored on disk on the file system.

Example Headers

Edit
$.diagnostics.originating.hostid = 554380dd342ba9aa0ca1926e4510b1be
CorrId = 71b5d720-f327-445c-944a-a65e00fa3a17\0
NServiceBus.ContentType = text/xml
NServiceBus.ConversationId = 68bb1275-9f9f-43ba-af20-a65e00fa3a1c
NServiceBus.CorrelationId = 71b5d720-f327-445c-944a-a65e00fa3a17
NServiceBus.DataBus.Core6.Headers.Writers.MyNamespace.MessageToSend.LargeProperty1 = 2016-08-10_15\94556444-49d4-4d90-9e00-d0c767b82605
NServiceBus.DataBus.Core6.Headers.Writers.MyNamespace.MessageToSend.LargeProperty2 = 2016-08-10_15\354c753e-e8af-425c-834f-ea7756d82fcf
NServiceBus.EnclosedMessageTypes = Core6.Headers.Writers.MyNamespace.MessageToSend, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
NServiceBus.MessageId = 71b5d720-f327-445c-944a-a65e00fa3a17
NServiceBus.MessageIntent = Send
NServiceBus.OriginatingEndpoint = HeaderWriterDataBusConventionV6
NServiceBus.OriginatingMachine = MACHINENAME
NServiceBus.ReplyToAddress = HeaderWriterDataBusConventionV6@MACHINENAME
NServiceBus.TimeSent = 2016-08-10 05:11:02:915987 Z
NServiceBus.Version = 6.0.0

Example Body

Edit
<?xml version="1.0"?><MessageToSend xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.net/Core6.Headers.Writers"></MessageToSend>

Samples

Related Articles


Last modified