Parley.Mqtt
1.0.1
dotnet add package Parley.Mqtt --version 1.0.1
NuGet\Install-Package Parley.Mqtt -Version 1.0.1
<PackageReference Include="Parley.Mqtt" Version="1.0.1" />
<PackageVersion Include="Parley.Mqtt" Version="1.0.1" />
<PackageReference Include="Parley.Mqtt" />
paket add Parley.Mqtt --version 1.0.1
#r "nuget: Parley.Mqtt, 1.0.1"
#:package Parley.Mqtt@1.0.1
#addin nuget:?package=Parley.Mqtt&version=1.0.1
#tool nuget:?package=Parley.Mqtt&version=1.0.1
Parley.Mqtt
Request/response RPC over MQTT — the transport-free protocol core, C# reference implementation.
dotnet add package Parley.Mqtt
Parley turns the MQTT broker you already share into something you can make requests over — request/reply, not just publish/subscribe. Call a command on another service or device, stream progress while it runs, cancel it, and receive one typed result: success or a clear error. Each command is four topic strings you choose, and every message carries a correlation id, so many calls share the same topics.
One wire protocol, four parallel reference libraries — C#, TypeScript/JS, Python and
C++ (ESP32/Arduino) — so a .NET service, an edge script, a Python service and firmware can all
call each other over the broker they already share. Parley.Mqtt is the C# one (the assembly and
namespace stay Parley). It is a small library, not a server: it rides your existing MQTT
connection and never holds your broker credentials or TLS material.
- Targets
net10.0andnetstandard2.0. Trim- and AOT-friendly via source-generated JSON; request, progress, result and error types are bound with ordinary generics — no schema compiler, no code generation, no build step. - Zero MQTT-client dependency. You supply a live connection through a tiny adapter you write over MQTTnet or whatever you already use, and Parley needs only MQTT 3.1.1 — no MQTT 5 broker required.
- Three distinct liveness outcomes. Nobody answered (
$noAck), it accepted and then went silent ($executionStale) and it ran too long ($executionTimeout) are separate results, driven by per-execution heartbeats rather than one guessed stopwatch. - At-most-once execution, correct even at QoS 0. Requests are re-sent until the other side shows a sign of life, results are re-sent until acknowledged, and duplicates are recognized and dropped on both sides. The guarantee is at most once per handler process lifetime, for as long as the handler retains dedup/tombstone state for that command id — the residual cases are written down in §9 of the protocol spec.
- Cancellation that reaches the running handler — a
CancellationTokenputs a real cancel on the wire, not a local give-up. Plus advisory progress streaming (IProgress<T>) and six built-in error codes alongside your own.
var topics = new ParleyTopics("home/backup/req", "home/backup/hb", "home/backup/prg", "home/backup/res");
using var commander = new ParleyCommander<BackupRequest, BackupProgress, BackupResult, string>(
adapter, topics, new ParleyConfig(), BackupJsonContext.Default);
var progress = new Progress<BackupProgress>(p => Console.WriteLine($"{p.Percent}%"));
ParleyResult<BackupResult, string> result =
await commander.ExecuteAsync(new BackupRequest("photos"), progress: progress);
if (result.IsSuccess) Console.WriteLine(result.Value!.BytesWritten);
else Console.WriteLine(result.Error.Code);
Documentation
- Repository: https://github.com/serionist/parley-mqtt
- The wire protocol (normative): https://github.com/serionist/parley-mqtt/blob/main/docs/protocol.md
- Worked C# example: https://github.com/serionist/parley-mqtt/tree/main/examples/csharp
- Design notes: https://github.com/serionist/parley-mqtt/blob/main/docs/design.md
License
MIT © The Parley Authors.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.TimeProvider (>= 10.0.10)
- System.Text.Json (>= 10.0.10)
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.