Skip to content

Fixed some MQTT broker related issues - #630

Open
wsobel wants to merge 2 commits into
mainfrom
mqtt-broker-fixes
Open

wsobel wants to merge 2 commits into
mainfrom
mqtt-broker-fixes

Conversation

@wsobel

@wsobel wsobel commented Nov 19, 2026

Copy link
Copy Markdown
Member

Fixed issues related to MQTT broker.

  1. Topics = Mill/# works without quotes. In agent.cfg, a # now starts a comment only at the start of a value or after a space or tab. Mill/#, Mill/+/# and a#b keep their #, and ducks = row # comment still drops the comment. The full agent.cfg tests pass unchanged. This also fixes the README’s own unquoted examples, which hit the same bug. The change is in src/mtconnect/configuration/parser.cpp.
  2. MqttHost = localhost works. A hostname is now looked up when the broker starts, preferring an IPv4 address, so localhost binds to 127.0.0.1. A name that can’t be looked up logs Cannot resolve bind address. The change is in src/mtconnect/source/adapter/mqtt/mqtt_broker_adapter.cpp.
  3. Pretty-printed JSON is ingested. JSON starting with a newline, space, or tab is now recognized as JSON. A UTF-8 byte-order mark is now removed before parsing.
  4. JSON goes to the device named in the topic. A publish to Lathe/data now lands on Lathe. When no part of the topic names a device, it still goes to the adapter’s Device, and device keys inside the JSON still decide where their values go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant