IMD SolutionComputing LibraryShop main store

Troubleshooting

Why Ignition 8.3 MQTT event streams lose the topic

Edge computing and IIoT Published 5 min read By IMD Solution engineering team

Short answer

In the tested Ignition 8.3 beta 4 Event Streams path, event.metadata is empty, so the MQTT source hands the handler only event.data and the topic never reaches the database. Put the resolved topic in a payload field and map it from event.data, or write a constant for a single fixed-topic stream.

On this page
  1. Where the MQTT topic stops
  2. Why the handler cannot reconstruct the topic
  3. Which topic-storage approach fits
  4. Diagnosing the missing-topic condition
  5. Worked example: mapping a source topic from a two-publisher stream
  6. Verifying the repair end to end
  7. Questions asked

The payload arrives and lands in the database, but the MQTT topic does not. In the tested Ignition 8.3 beta 4 Event Streams path, the MQTT source populates event.data with the payload and leaves event.metadata empty, so the topic never enters the event object and no database mapping can recover it. The fix is at the publisher: put the resolved topic inside the payload and map it from event.data, or configure a constant when one stream serves exactly one fixed topic.

Where the MQTT topic stops #

Follow the packet up the stack. Once the expected payload shows up in event.data, the network path, the MQTT connection, the broker routing and the source subscription are all proven to carry application data. The remaining fault domain is the event object itself.

Path stage Expected information Observed result in beta 4 Decision
MQTT publisher Topic plus payload Payload reaches Ignition Publication path is operating
MQTT server Routes the publication to the subscriber Event is generated Subscription path is operating
Event Streams MQTT source Event data and metadata Payload in event.data; event.metadata empty Topic is not passed into the tested event contract
Database handler Fields supplied by the event No event field contains the topic The handler cannot recover what never arrived

A mapping change cannot restore information that is absent before the database handler runs. Checking SQL column types or transaction behavior is wasted effort until the topic has first been made visible as event data. This is a different fault from unreadable binary payloads, which damage the bytes themselves rather than the context around them.

Why the handler cannot reconstruct the topic #

MQTT transports the topic separately from the application payload. When an adapter emits only the payload bytes into an internal event, downstream components cannot derive the original topic from those bytes unless the publisher encoded that identity in the payload. Identical payloads may legitimately arrive on different topics, so payload inspection is not a reliable inverse mapping.

The outbound handler limitations do not repair this inbound loss. In the tested beta 4 configuration:

Setting or interface Observed behavior Impact
MQTT source metadata event.metadata is empty No native inbound topic for the database mapping
Publish Topic No Handler Expressions support An outbound topic cannot be calculated from event content
Server target Single-server selection A defined Set cannot choose the connected server for the handler
system.cirruslink.engine.publish No Set target described Script publishing cannot delegate server selection to a Set
Retain Not exposed; publications are not retained The handler cannot create a retained topic state

Which topic-storage approach fits #

Approach When it works Tradeoff Decision
Read the topic from event.metadata Only when the source populates a topic field Empty in the tested beta 4 configuration Do not build on this path in beta 4
Topic inside the payload Publisher can construct its payload Publisher change; duplicates the routing key in the body Preferred when each row must keep its originating topic
Constant topic One stream, one known topic, no aggregation Wrong the moment the subscription scope widens Acceptable for a tightly controlled single-topic path
Wait for native metadata A later build documents and exposes the topic Blocks topic-aware storage until then Evaluate during an upgrade, do not assume it

Diagnosing the missing-topic condition #

  1. Confirm physical connectivity and the MQTT connection state before touching Event Streams.
  2. Publish a test message with a unique, easily identified payload on the real production topic path.
  3. Observe the MQTT source event and confirm the unique payload appears in event.data.
  4. Inspect event.metadata. In the beta 4 case it is empty rather than holding the topic.
  5. Inspect the database destination mapping and confirm it references event.data and that no mapped field contains the topic.
  6. Classify: payload missing means troubleshoot network, connection, subscription or source; payload present with topic absent means change the event contract or supply the topic as application data.

Do not add retries or database indexes to fix a field that never enters the event. The same classification habit separates transport faults from context faults in store and forward backfill work, where the question is whether buffered records survived rather than what context they carried.

Worked example: mapping a source topic from a two-publisher stream #

Inputs. Two publishers feed one Event Stream through a subscription that matches both. Each publishes on its own topic, for example a line controller publishing machine state and a meter publishing energy readings. In the tested beta 4 path the source delivers only the payload in event.data; event.metadata is empty. The database table requires one topic column per row for provenance.

Rule. A database handler can store only fields that exist in the event. If the topic is not in the event, add it to the payload at the publisher and map that payload field from event.data.

Arithmetic. Count the topic values each approach can produce for the two messages:

  • Native metadata path: 0 usable fields (metadata empty) × 2 messages = 0 of 2 rows with a topic.
  • Payload field approach: 1 mapped field per message × 2 messages = 2 of 2 rows with the correct individual topic.
  • Constant approach: 1 fixed value for 2 different topics = 1 correct row, 1 wrong row, because the constant matches only one publisher's topic.

Result. With two live topics behind one stream, only the payload-field approach stores the right topic on every row. The constant approach fails on 1 of the 2 messages, and the metadata path stores nothing.

Decision. One topic behind the stream: a constant is acceptable, but record the coupling in the stream configuration so a later subscription change triggers a mapping update. Two or more topics, or any chance the subscription will widen: the publisher puts its resolved topic in a dedicated payload field, for example an application-defined sourceTopic key, and the database mapping reads it from event.data. Flag or reject records whose field is missing when provenance is mandatory. Never copy the wildcard subscription filter into rows as though it were the concrete publication topic.

Verifying the repair end to end #

  1. Publish two distinguishable messages on the two topic paths the source receives.
  2. Confirm each event carries its matching topic field inside event.data.
  3. Confirm the database creates two rows, each pairing the right payload with the right topic.
  4. Widen nothing until that two-row test passes; the outbound Publish Topic and Set limitations in beta 4 mean you cannot compensate downstream, so the fix has to hold at the publisher.

Questions asked

Why can't a database mapping expression recover the topic from the payload?

MQTT carries the topic separately from the payload. Once the source emits only payload bytes into event.data, the handler has nothing to derive the topic from; similar payloads can arrive on different topics, so payload inspection is not a reliable reverse mapping. The mapping can only store what entered the event.

Does system.cirruslink.engine.publish let me re-publish with a dynamic topic as a workaround?

No. In the tested beta 4 configuration, Publish Topic does not accept Handler Expressions, and the script call does not describe a Set target, so an outbound topic cannot be calculated from event content. The outbound handler limitations do not repair the inbound loss.

Can I store my wildcard subscription filter as the topic instead?

Only if per-message provenance does not matter. A subscription filter can match many topic paths, so copying it into every row records the filter, not the concrete publication topic. When rows must trace back to their originating topic, the publisher has to include the resolved topic.

Should I wait for a later 8.3 build to expose the topic natively?

Only if topic-aware storage can wait. The observed beta 4 behavior may change in later builds, but treat that as unverified until release documentation states it and you test it. For production now, embed the topic in the payload so the design does not depend on undocumented metadata.

Keep reading

  • How-to

    Turn an MQTT topic into InfluxDB fields with Telegraf

    Telegraf reads /temperature/boiler/room3 with payload 21.7 as a metric carrying a topic tag and a value field. A five-processor chain (regex, converter, regex, regex, pivot) renames the measurement, builds location=room3 and pivots the middle segment into the field key; one Starlark processor does the same in eight lines. Either way the output line is temperature,location=room3 boiler=21.7 with the original timestamp.

    Edge computing and IIoT

  • Troubleshooting

    Why MQTT Transmission history is lost after a 50-second outage

    A 50-second outage on a 10-second write cycle should replay five buffered sets; a 100k store with a full day of retention cannot be the constraint. The sets are lost at the receiving gateway: Engine tag history, Store Historical Events, a mismatched primary host ID, or an invalid test that stops Transmission. Clear the store with arithmetic, then trace each handoff to MS SQL.

    Edge computing and IIoT

  • Selection guide

    Choosing an edge data path for periodic records

    For independent periodic samples, Tag Historian with Edge Sync Services is the reliable path and buffers 35 days locally. For one atomic row per collection cycle, use MQTT Transmission records landing in MQTT Recorder. For true transaction groups, license a standard gateway for that node.

    Edge computing and IIoT

Why Data Service metadata topic subscription failed