MTConnect.NET-AgentModule-MqttRelay
7.2.0.105
dotnet add package MTConnect.NET-AgentModule-MqttRelay --version 7.2.0.105
NuGet\Install-Package MTConnect.NET-AgentModule-MqttRelay -Version 7.2.0.105
<PackageReference Include="MTConnect.NET-AgentModule-MqttRelay" Version="7.2.0.105" />
<PackageVersion Include="MTConnect.NET-AgentModule-MqttRelay" Version="7.2.0.105" />
<PackageReference Include="MTConnect.NET-AgentModule-MqttRelay" />
paket add MTConnect.NET-AgentModule-MqttRelay --version 7.2.0.105
#r "nuget: MTConnect.NET-AgentModule-MqttRelay, 7.2.0.105"
#:package MTConnect.NET-AgentModule-MqttRelay@7.2.0.105
#addin nuget:?package=MTConnect.NET-AgentModule-MqttRelay&version=7.2.0.105
#tool nuget:?package=MTConnect.NET-AgentModule-MqttRelay&version=7.2.0.105

MTConnect MQTT Relay Module
This Agent Module writes data to an External MQTT Broker
Configuration
modules:
- mqtt-relay:
server: localhost
port: 1883
topicPrefix: enterprise/site/area/line/cell/MTConnect
topicStructure: Document
server- The MQTT broker hostname. Default islocalhostport- The MQTT broker port number. Default is1883timeout- The timeout (in milliseconds) to use for connection and read/write. Default is5000reconnectInterval- The interval (in milliseconds) to delay between disconnections. Default is10000username- Sets the Username to use for authenticationpassword- Sets the Password to use for authenticationclientId- Sets the Client ID to use for the connectionqos- Sets the Quality Of Service (Qos) to use. 0 = At Most Once, 1 = At least Once, 2 = Exactly Once. Only applies whentopicStructureisEntity. WhentopicStructureisDocument, messages are published with QoS 1 (At least Once)useTls- Sets whether to use TLS or not (true or false)topicPrefix- The prefix to add to the MQTT topics that are published. Default isMTConnecttopicStructure- (Document or Entity) Sets how MQTT topics and messages are structured. Default isDocumentcurrentInterval- Sets the Interval (in milliseconds) to send Current messages at. Default is5000sampleInterval- Sets the Interval (in milliseconds) to send Sample messages at. Default is500documentFormat- The Document Format ID to use to format the payload. Default isjson-cppagentindentOutput- Sets whether to indent the output in each payload. Default isfalsedurableRelay- Enables durable relay mode. When set totrue, the module saves the sequence number of the last observation it sent to disk and, after a network reconnect or agent restart, relays the observations it missed from the Agent's observation buffer. Observations that are no longer in the Agent's buffer cannot be relayed. Default isfalse.tls- Sets the TLS settingspfx- The PFX certificate settingscertificatePath- The path to the (.pfx) filecertificatePassword- The certificate password
pem- The PEM certificate settingscertificatePath- The path to the (.pem) fileprivateKeyPath- The path to the key containing the private keyprivateKeyPassword- The certificate passwordcertificateAuthority- The path to the (.pem) file containing the Certificate Authority
verifyClientCertificate- Sets whether the MQTT broker's certificate must be trusted ("true" or "false"). Whenfalse(default), untrusted certificates are acceptedomitCAValidation- Whentrue, the Certificate Authority is not included in the certificates sent to the MQTT broker ("true" or "false"). Default isfalse
AWS IoT Configuration Example
modules:
- mqtt-relay:
server: akljadkfjdlsf-ats.iot.us-east-1.amazonaws.com
port: 8883
tls:
pem:
certificateAuthority: certs/AmazonRootCA1.pem
certificatePath: certs/asfdslkafjdslkfjdklsdjf-certificate.pem.crt
privateKeyPath: certs/sdlkajlksdajfldskjfdldlskfjdslkaj-private.pem.key
documentFormat: json-cppagent
currentInterval: 5000
sampleInterval: 500
topicPrefix: enterprise/site/area/line/cell/MTConnect
AWS Greengrass Moquette Configuration Example
modules:
- mqtt-relay:
server: localhost
port: 8883
clientId: mtconnect-test # Set the ClientId to the AWS Thing ID
tls:
verifyClientCertificate: false
pem:
certificateAuthority: certs/AmazonRootCA1.pem
certificatePath: certs/2316549874654321654984984158961634984794-certificate.pem.crt
privateKeyPath: certs/2316549874654321654984984158961634984794-private.pem.key
documentFormat: json-cppagent
currentInterval: 5000
sampleInterval: 500
topicPrefix: enterprise/site/area/line/cell/MTConnect
HiveMQ Configuration Example
modules:
- mqtt-relay:
server: 5679887d308d402888f32.s1.eu.hivemq.cloud
port: 8883
username: mtconnect
password: mtconnect
useTls: true
documentFormat: json-cppagent
currentInterval: 5000
sampleInterval: 500
topicPrefix: enterprise/site/area/line/cell/MTConnect
Topics
When topicStructure is Document, the following topics are published. Probe, Asset and Agent Available messages are retained; Current and Sample messages are not.
[TOPIC_PREFIX]/Probe/[DEVICE_UUID]
[TOPIC_PREFIX]/Current/[DEVICE_UUID]
[TOPIC_PREFIX]/Sample/[DEVICE_UUID]
[TOPIC_PREFIX]/Asset/[DEVICE_UUID]/[ASSET_ID]
[TOPIC_PREFIX]/Agent/[AGENT_UUID]/Available
Migration: Availability Topic Moved Out of Probe/#
In earlier releases the MqttRelay agent module published the agent's
Availability state (Last Will and Testament plus the on-connect retained
"AVAILABLE" message) on a four-segment topic that fell under the
{TopicPrefix}/Probe/# wildcard:
{TopicPrefix}/Probe/{AgentUuid}/Available (raw "AVAILABLE" / "UNAVAILABLE" UTF-8 bytes)
That broke the contract that every payload under the Probe wildcard is a
JSON document envelope. Subscribers binding to {TopicPrefix}/Probe/#
expecting only Probe document JSON would receive a non-JSON Availability
payload and either crash or silently drop the message.
Starting with this release the module emits agent Availability on a dedicated, non-overlapping topic:
{TopicPrefix}/Agent/{AgentUuid}/Available (raw "AVAILABLE" / "UNAVAILABLE" UTF-8 bytes)
This matches the cppagent reference implementation (mtconnect/cppagent) which also publishes JSON document envelopes only under the Probe wildcard and emits agent status on a dedicated agent / status topic. The Probe wildcard is now pure-JSON for any subscriber.
Action required when upgrading
- Subscribers that relied on the old
{TopicPrefix}/Probe/{AgentUuid}/Availabletopic to track agent Availability must subscribe to{TopicPrefix}/Agent/{AgentUuid}/Availableinstead. - Any retained-message cleanup tooling pointed at the old topic should be updated to clear the new topic on broker rotations.
Contribution / Feedback
- Please use the Issues tab to create issues for specific problems that you may encounter
- Please feel free to use the Pull Requests tab for any suggested improvements to the source code
- For any other questions or feedback, please contact TrakHound directly at info@trakhound.com.
License
This application and its source code is licensed under the MIT License and is free to use.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 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 is compatible. 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 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. 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. |
-
.NETFramework 4.6.1
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
.NETFramework 4.6.2
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
.NETFramework 4.7
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
.NETFramework 4.7.1
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
.NETFramework 4.7.2
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
.NETFramework 4.8
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
.NETStandard 2.0
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
net10.0
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
net6.0
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
net7.0
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
net8.0
- MTConnect.NET-MQTT (>= 7.2.0.105)
-
net9.0
- MTConnect.NET-MQTT (>= 7.2.0.105)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MTConnect.NET-AgentModule-MqttRelay:
| Package | Downloads |
|---|---|
|
MTConnect.NET-Applications-Agents
MTConnect.NET-Applications-Agents contains classes to fully implement an MTConnect Agent application. Supports MTConnect versions up to 2.7. Supports .NET Framework 4.6.1 up to .NET 10 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.2.0.105 | 98 | 11/21/2026 |
| 7.2.0.105-prerelease | 92 | 11/21/2026 |
| 7.2.0.103-prerelease | 100 | 11/20/2026 |
| 7.1.0.1-prerelease | 66 | 9/13/2026 |
| 7.0.0.2-prerelease | 248 | 6/26/2026 |
| 7.0.0.1-prerelease | 57 | 9/13/2026 |
| 6.9.0.2 | 756 | 10/16/2025 |
| 6.8.0 | 329 | 9/13/2025 |
| 6.7.0 | 285 | 6/22/2025 |
| 6.6.0 | 434 | 1/18/2025 |
| 6.5.1 | 319 | 12/3/2024 |
| 6.5.0 | 378 | 10/21/2024 |
| 6.4.7 | 331 | 8/21/2024 |
| 6.4.6 | 277 | 8/7/2024 |
| 6.4.5 | 271 | 8/2/2024 |
| 6.4.4 | 266 | 7/16/2024 |
| 6.4.3 | 320 | 6/14/2024 |
| 6.4.2 | 283 | 6/12/2024 |
| 6.4.1 | 284 | 5/17/2024 |
| 6.4.0 | 281 | 5/14/2024 |