Skip to content

Serializer package overview

Typed publish, route, stream, and request/response APIs use one IMqttSerializer per client. Choose one serializer package for each named client and keep mixed wire formats on separate clients or on the raw MqttPublishPacket APIs.

PackagePageUse when
Pulse.Mqtt.Serialization.JsonJSON serializerPayloads should be human-readable UTF-8 JSON and Native AOT safe through source generation.
Pulse.Mqtt.Serialization.MessagePackMessagePack serializerPayloads should be compact binary data while keeping generated resolver support.
Pulse.Mqtt.Serialization.ProtobufProtobuf serializerPayloads are generated Protocol Buffers messages with explicit parser registration.

All serializer packages plug into the same client option or dependency-injection swap:

csharp
.UseSerializer(_ => serializer)
csharp
new ResilientMqttClientOptions
{
    Connect = new MqttConnectPacket { ClientId = "worker" },
    Serializer = serializer,
};

The serializer stamps MQTT payload metadata on typed publishes. Consumers can inspect content type and payload format even when they are not using Pulse.Mqtt.

See Typed messaging for end-to-end publish, route, stream, and request/response examples.

Released under the MIT License.