Skip to content

Package add-ons

Pulse.Mqtt keeps the resilient client small and adds focused packages for hosting, storage, payload formats, pipelines, transport, tests, and compile-time guidance. Add only the packages a project actually uses.

Start with the client

Most services start with the client, hosting integration, and one serializer:

shell
dotnet add package Pulse.Mqtt.Client
dotnet add package Pulse.Mqtt.DependencyInjection
dotnet add package Pulse.Mqtt.Serialization.Json
csharp
builder.Services
    .AddPulseMqttClient("devices", options =>
    {
        options.Host = "broker.example.com";
        options.ClientId = "device-worker";
    })
    .UseSerializer(_ => new JsonMqttSerializer(AppJsonContext.Default));

Pulse.Mqtt.Core comes in transitively. Reference it directly only when building on the raw codec, raw client, or swap-point contracts without the resilient client.

Pick add-ons by job

JobAdd packagePackage docs
Host-managed clients, keyed DI, options binding, health checksPulse.Mqtt.DependencyInjectionDependency injection
Minimal-API-style topic endpointsPulse.Mqtt.EndpointsEndpoints
Durable relational session and queue storagePulse.Mqtt.Storage.SqliteSQLite storage
Durable server database session and queue storagePulse.Mqtt.Storage.SqlServerSQL Server storage
Durable embedded document session and queue storagePulse.Mqtt.Storage.LiteDBLiteDB storage
Bounded worker pipelines over messages, routes, acknowledgements, or statePulse.Mqtt.DataflowDataflow
Source-generated UTF-8 JSON typed payloadsPulse.Mqtt.Serialization.JsonJSON serializer
Compact binary typed payloads with generated resolversPulse.Mqtt.Serialization.MessagePackMessagePack serializer
Generated Protocol Buffers typed payloadsPulse.Mqtt.Serialization.ProtobufProtobuf serializer
MQTT over ws or wssPulse.Mqtt.Transport.WebSocketWebSocket transport
MQTT over QUIC (EMQX-style listeners, .NET 10)Pulse.Mqtt.Transport.QuicQUIC transport
Reconnect timing owned by a resilience pipelinePulse.Mqtt.Resilience.PollyReconnect policy
In-process workflow testsPulse.Mqtt.TestingTesting
Compile-time warnings for common mistakesPulse.Mqtt.AnalyzersAnalyzers

The full package list, targets, and dependency relationships are in Packages.

Common combinations

Application shapePackages
Hosted service with typed JSONClient, DependencyInjection, Serialization.Json
Durable offline workerClient, DependencyInjection, Serialization.Json, one storage package
Bounded processing pipelineClient, DependencyInjection, Dataflow, one serializer
Browser/proxy broker endpointClient, DependencyInjection, Transport.WebSocket, one serializer
Integration-style testsClient, Testing, optionally DependencyInjection
Strict application projectruntime packages plus Analyzers with PrivateAssets="all"

Choosing between similar add-ons

Choose one serializer per named client. Use JSON for readable payloads and broad interop, MessagePack for compact generated binary contracts, and Protobuf when messages already come from .proto definitions.

Choose one durable storage package per client in most applications. SQLite is a good default when you want a relational file store and easy inspection. SQL Server is a good fit when durable client state should live in managed database infrastructure. LiteDB is a good fit when an embedded document database is already part of the application.

Use Dataflow when pipeline composition, bounded buffering, backpressure, completion, or fault propagation matter. Use the client route and stream APIs directly when a simple handler or await foreach loop is enough.

Package docs

Every add-on has a dedicated page under Package docs. Those pages include install commands, setup examples, behavior notes, limitations, and links to the deeper guide pages.

Released under the MIT License.