A high performance .NET library for MQTT: client and server (broker)
open sourceMITfree
MQTTnet is a .NET library for MQTT, the publish and subscribe protocol for IoT devices and messaging. It has a client, with a low level client and a managed one that keeps the connection and subscriptions up and queues messages for higher QoS levels, and a server (broker) you can embed in your own app, with hooks to validate clients' credentials and subscriptions and to intercept or change every message. It speaks MQTT up to version 5 over TCP, TLS and WebSockets (the broker's WebSockets through ASP.NET Core, a separate package), has no external dependencies, and works with Azure IoT Hub. It's supported by the .NET Foundation.
Problems it solves
- connect my C# app to an MQTT broker and publish and subscribe to topics
- run an MQTT broker inside my .NET application instead of a separate server
- keep an MQTT connection and its subscriptions alive automatically in .NET
- talk to IoT devices from a .NET service over MQTT 5
Features
- MQTT client and an embeddable MQTT server (broker) in one library
- supports MQTT 3.1.0, 3.1.1 and 5.0
- TCP, TLS and WebSocket transports
- managed client that reconnects, restores subscriptions and queues messages
- broker hooks to validate credentials and subscriptions and intercept messages
- no external dependencies
