EasyMQTTnet 2.0.0
dotnet add package EasyMQTTnet --version 2.0.0
NuGet\Install-Package EasyMQTTnet -Version 2.0.0
<PackageReference Include="EasyMQTTnet" Version="2.0.0" />
<PackageVersion Include="EasyMQTTnet" Version="2.0.0" />
<PackageReference Include="EasyMQTTnet" />
paket add EasyMQTTnet --version 2.0.0
#r "nuget: EasyMQTTnet, 2.0.0"
#:package EasyMQTTnet@2.0.0
#addin nuget:?package=EasyMQTTnet&version=2.0.0
#tool nuget:?package=EasyMQTTnet&version=2.0.0
EasyMQTTnet
A .NET API for Message Queuing with MQTT
Goals:
- To make working with Message Queuing on .NET as easy as possible.
To connect to a MQTT broker...
var bus = EasyMqttFactory.CreateBus("server=localhost");
To publish a message...
bus.Publish(message);
To subscribe to a message...
bus.Subscribe<MyMessage>(msg => Console.WriteLine(msg.Text));
The goal of EasyMQTTnet is to provide a library that makes working with Message Queuing in .NET as simple as possible. In order to do this, it has to take an opinionated view of how you should use EasyMQTTnet with .NET. It trades flexibility for simplicity by enforcing some simple conventions. These include:
- Messages should be represented by .NET types.
- Messages should be routed by their .NET type.
This means that messages are defined by .NET classes. Each distinct message type that you want to send is represented by a class. The class should be public with a default constructor and public read/write properties. You would not normally implement any functionality in a message, but treat it as a simple data container or Data Transfer Object (DTO). Here is a simple message:
public class MyMessage
{
public string Text { get; set; }
}
EasyMQTTnet routes messages by their type. When you publish a message, EasyMQTTnet examines its type and gives it a routing key based on the type name, namespace and assembly. On the consuming side, subscribers subscribe to a type. After subscribing to a type, messages of that type get routed to the subscriber.
By default, EasyMQTTnet serializes .NET types as JSON using the Newtonsoft.Json library. This has the advantage that messages are human readable, so you can use tools to debug message problems.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- MQTTnet (>= 5.0.1.1416)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.