Message type detection

Component: NServiceBus

In order to invoke the correct message handlers for incoming messages, NServiceBus must be able to map the incoming transport message to a message type.

The mapping rules are as follows:

  1. If the message contains the NServiceBus.EnclosedMessageTypes header, the header value is used to find the message type. The header value must contain at least the FullName of the message type but can also contain the AssemblyQualifiedName. NServiceBus uses the AssemblyQualifiedName when emitting messages.

  2. If the header is missing, serializers can optionally infer the message type based on the message payload.

Serializers that support message type inference

  • Xml via the root node name
  • Json.NET via a custom $type property

Last modified