Summary
Every envelope published by the mqtt-relay module (and, by extension, any consumer of the shared Header serialiser) reports Header.version as the library's own assembly version (e.g. "6.9.0.0" on v6.9.0.2), rather than the MTConnect Standard release the agent is serving. This misidentifies the agent to every downstream consumer and breaks any logic that branches on spec version.
Verified by reproduction — 2026-04-20
Reproduced live against trakhound/mtconnect.net-agent:6.9.0 (the official TrakHound image published 2025-10-16 alongside v6.9.0.2) with eclipse-mosquitto:2.0.22 as the broker. The Header.version slot emits "6.9.0.0" on every MTConnectStreams MQTT envelope, and version="6.9.0.0" on the HTTP XML Probe Header, regardless of any defaultVersion value set in agent.config.yaml. Side-by-side comparison: cppagent v2.7.0.7 in an identical configuration emits "2.7.0.7" in the same slot — correctly reporting the agent's MTConnect release.
Environment
MTConnect.NET-Applications-Agents + MTConnect.NET-SHDR + MTConnect.NET-JSON-cppagent at v6.9.0.2 (published 2025-10-16, the latest release).
- Broker:
eclipse-mosquitto:2.0.22.
- Format ID:
JSON-cppagent-mqtt (the same shared Header serialiser is also used for JSON-CPPAGENT — please confirm the scope when fixing).
Reproduction
applications/MTConnect-Agent/appsettings.yaml (minimum viable):
defaultVersion: 2.5.0.0 # the library's advertised ceiling; any valid value surfaces the same bug
modules:
- mqtt-relay:
server: localhost
port: 1883
topicPrefix: MTConnect
documentFormat: JSON-cppagent-mqtt
Start a local Mosquitto (eclipse-mosquitto:2.0.22 on 127.0.0.1:1883), run the agent, and subscribe:
mosquitto_sub -h localhost -t 'MTConnect/Current/#' -C 1 | jq '.MTConnectStreams.Header.version'
Observed
Expected
(With defaultVersion unset, the companion hardcoded-schemaVersion issue #128 further forces this to "2.0"; with defaultVersion correctly wired to the configured release, it should echo that release.)
Authority
MTConnectStreams_2.7.xsd (identical wording in _2.5.xsd and _2.6.xsd):
<xs:attributeGroup name='HeaderAttributesType'>
<xs:attribute name='version' type='VersionType' use='required'>
<xs:annotation>
<xs:documentation>The document version</xs:documentation>
</xs:annotation>
</xs:attribute>
...
</xs:attributeGroup>
<xs:simpleType name='VersionType'>
<xs:restriction base='xs:NMTOKEN'/>
</xs:simpleType>
The XSD does not pattern-constrain VersionType, but the MTConnect prose standard, Part 1 (Overview, §5) and Part 2 (Devices Information Model, §7 Header), documents version as the MTConnect Standard release the agent serves (e.g. "2.5.0.0", "2.7.0.0").
The cppagent reference implementation emits exactly that — "2.7.0.0" on a v2.7 agent, "2.5.0.0" on a v2.5 agent. The format ID JSON-CPPAGENT-MQTT is itself an explicit promise of cppagent-reference compatibility; diverging here breaks both the prose-spec contract and the format-label contract.
Impact
- Consumers that branch on
Header.version to decide whether v2.x-only fields should be surfaced receive a version string they can never match against any published MTConnect release.
- Strict cppagent-shape consumers fail format-label validation.
- Operational diagnostics (e.g. schema registries, compliance dashboards) misreport the agent as running an undefined "6.9.x" MTConnect version.
Location in source
Shared Header serialiser used by libraries/MTConnect.NET-JSON-cppagent/Formatters/JsonMqttResponseDocumentFormatter.cs. The encoder currently reads the MTConnect.NET assembly version when populating the version slot instead of the configured DefaultVersion / agent release.
Suggested fix
- Emit the configured MTConnect release as
Header.version — the same value used for schemaVersion. Library assembly version should be exposed via metrics, a non-standard extension field, or a sender suffix, but never in the spec-defined version slot.
- If the value is currently pulled from
Assembly.GetExecutingAssembly().GetName().Version, switch to reading the agent's configured MTConnect version (AgentApplicationConfiguration.DefaultVersion or equivalent).
Stability across MTConnect versions
Identical across v2.5, v2.6, v2.7 — HeaderAttributesType.version has been a required attribute typed VersionType since v1.3+, and the prose-spec guidance that this reflects the MTConnect release has been stable across every v2.x release.
Related issues
References
Summary
Every envelope published by the
mqtt-relaymodule (and, by extension, any consumer of the shared Header serialiser) reportsHeader.versionas the library's own assembly version (e.g."6.9.0.0"onv6.9.0.2), rather than the MTConnect Standard release the agent is serving. This misidentifies the agent to every downstream consumer and breaks any logic that branches on spec version.Verified by reproduction — 2026-04-20
Reproduced live against
trakhound/mtconnect.net-agent:6.9.0(the official TrakHound image published 2025-10-16 alongside v6.9.0.2) witheclipse-mosquitto:2.0.22as the broker. TheHeader.versionslot emits"6.9.0.0"on everyMTConnectStreamsMQTT envelope, andversion="6.9.0.0"on the HTTP XML Probe Header, regardless of anydefaultVersionvalue set inagent.config.yaml. Side-by-side comparison: cppagent v2.7.0.7 in an identical configuration emits"2.7.0.7"in the same slot — correctly reporting the agent's MTConnect release.Environment
MTConnect.NET-Applications-Agents+MTConnect.NET-SHDR+MTConnect.NET-JSON-cppagentatv6.9.0.2(published 2025-10-16, the latest release).eclipse-mosquitto:2.0.22.JSON-cppagent-mqtt(the same shared Header serialiser is also used forJSON-CPPAGENT— please confirm the scope when fixing).Reproduction
applications/MTConnect-Agent/appsettings.yaml(minimum viable):Start a local Mosquitto (
eclipse-mosquitto:2.0.22on127.0.0.1:1883), run the agent, and subscribe:Observed
"6.9.0.0"Expected
"2.5.0.0"(With
defaultVersionunset, the companion hardcoded-schemaVersionissue #128 further forces this to"2.0"; withdefaultVersioncorrectly wired to the configured release, it should echo that release.)Authority
MTConnectStreams_2.7.xsd(identical wording in_2.5.xsdand_2.6.xsd):The XSD does not pattern-constrain
VersionType, but the MTConnect prose standard, Part 1 (Overview, §5) and Part 2 (Devices Information Model, §7 Header), documentsversionas the MTConnect Standard release the agent serves (e.g."2.5.0.0","2.7.0.0").The cppagent reference implementation emits exactly that —
"2.7.0.0"on a v2.7 agent,"2.5.0.0"on a v2.5 agent. The format IDJSON-CPPAGENT-MQTTis itself an explicit promise of cppagent-reference compatibility; diverging here breaks both the prose-spec contract and the format-label contract.Impact
Header.versionto decide whether v2.x-only fields should be surfaced receive a version string they can never match against any published MTConnect release.Location in source
Shared Header serialiser used by
libraries/MTConnect.NET-JSON-cppagent/Formatters/JsonMqttResponseDocumentFormatter.cs. The encoder currently reads the MTConnect.NET assembly version when populating theversionslot instead of the configuredDefaultVersion/ agent release.Suggested fix
Header.version— the same value used forschemaVersion. Library assembly version should be exposed via metrics, a non-standard extension field, or asendersuffix, but never in the spec-definedversionslot.Assembly.GetExecutingAssembly().GetName().Version, switch to reading the agent's configured MTConnect version (AgentApplicationConfiguration.DefaultVersionor equivalent).Stability across MTConnect versions
Identical across v2.5, v2.6, v2.7 —
HeaderAttributesType.versionhas been a required attribute typedVersionTypesince v1.3+, and the prose-spec guidance that this reflects the MTConnect release has been stable across every v2.x release.Related issues
MTConnectStreams.schemaVersion/MTConnectDevices.schemaVersionhardcoded to"2.0"inJSON-cppagent-mqttformatter #128 —MTConnectStreams.schemaVersion/MTConnectDevices.schemaVersionhardcoded to"2.0"— same envelope, adjacent root cause; the two slots should report the same MTConnect release.References
MTConnectStreams_2.7.xsd,MTConnectStreams_2.6.xsd,MTConnectStreams_2.5.xsd.MTConnectSysMLModel.xml.