ProtoBuf-Google Serializer

Project Hosting | Nuget: NServiceBus.ProtoBufGoogle (Version: 1.x) | License
This is a community run project. License and support are independent of Particular Software.
Target NServiceBus Version: 6.x

Serializes messages using Google Protocol Buffers.

There are two serializers that target Protocol Buffers. The ProtoBuf-Google serailizer targets the Google.Protobuf NuGet package, while the ProtoBuf-Net serailizer targets the protobuf-net NuGet package.

Usage

Edit
endpointConfiguration.UseSerialization<ProtoBufGoogleSerializer>();

This serializer does not support Messages defined as Interfaces. Instead use a public class with the same contract as the interface. The class can optionally implement any required interfaces.

If an explicit interface is send an exception will be thrown with the following message:

Interface based message are not supported. 
Create a class that implements the desired interface

Custom Settings

Customizes the instance of SerializerOptions used for serialization.

Custom Content Key

When using additional deserializers or transitioning between different versions of the same serializer it can be helpful to take explicit control over the content type a serializer passes to NServiceBus (to be used for the ContentType header).

Edit
var serialization = endpointConfiguration.UseSerialization<ProtoBufGoogleSerializer>();
serialization.ContentTypeKey("custom-key");

More Info

For more information on Google Protocol Buffers see

Samples

Related Articles


Last modified