Wire Serializer Usage

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

Configuring to use Wire

var busConfiguration = new BusConfiguration();
busConfiguration.EndpointName("Samples.Serialization.Wire");
busConfiguration.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
        },
    }
};
bus.SendLocal(message);

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