Wire Serializer Usage

Component: Wire Serializer
NuGet Package NServiceBus.Wire (3.x)
This is a community maintained project
Target NServiceBus Version: 7.x

Configuring to use Wire

var endpointConfiguration = new EndpointConfiguration("Samples.Serialization.Wire");
endpointConfiguration.UseSerialization<WireSerializer>();

Sending a message

var message = new CreateOrder
{
    OrderId = 9,
    Date = DateTime.Now,
    CustomerId = 12,
    OrderItems = new List<OrderItem>
    {
        new OrderItem
        {
            ItemId = 6,
            Quantity = 2
        },
        new OrderItem
        {
            ItemId = 5,
            Quantity = 4
        },
    }
};
await endpointInstance.SendLocal(message)
    .ConfigureAwait(false);

The output

Since Wire is a binary format, the message body is not human-readable.

Related Articles

  • Serialization
    Information about how messages are serialized and deserialized on a transport.
  • Wire Serializer
    How to serialize messages with the Wire binary format.

Last modified