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 may contain:
    • The FullName of the message type.
    • The AssemblyQualifiedName of the message type (with or without private key are both supported)
    • The Name of the type, without the assembly name.

NServiceBus uses the AssemblyQualifiedName when emitting messages.

  1. 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