ZeroFormatter Serializer Usage

Component: ZeroFormatter Serializer | Nuget: NServiceBus.ZeroFormatter (Version: 1.x)
This is a community run project
Target NServiceBus Version: 6.x

Configuring to use ZeroFormatter

Edit
var endpointConfiguration = new EndpointConfiguration("Samples.Serialization.ZeroFormatter");
endpointConfiguration.UseSerialization<ZeroSerializer>();

The message

Edit
[ZeroFormattable]
public class CreateOrder :
    IMessage
{
    [Index(0)]
    public virtual int OrderId { get; set; }

    [Index(1)]
    public virtual long Date { get; set; }

    [Index(2)]
    public virtual int CustomerId { get; set; }
}

The message send

The message is decorated with ZeroFormatter Attributes.

Edit
var message = new CreateOrder
{
    OrderId = 9,
    Date = DateTime.Now.Ticks,
    CustomerId = 12,
};
await endpointInstance.SendLocal(message)
    .ConfigureAwait(false);

Related Articles


Last modified