IMD SolutionComputing LibraryShop main store

Troubleshooting

Why MQTT Engine still feeds old tags after a broker stops

Edge computing and IIoT Published 9 min read

Short answer

Old values keep reaching the screens because MQTT Engine buffers and processes each Edge node's messages in order, so a birth-message flood drains through the tags even after the broker is stopped. Measure the queue with Enable Latency Check and Message Processing Latency, fix the flooding node first, and restart the module only to clear what the fixed cause already built.

On this page
  1. Why do the screens keep changing after the broker is shut down?
  2. Where in the path is the backlog actually sitting?
  3. Is the node still publishing, or is the gateway draining a backlog?
  4. Example: how long does an hour of buffered data take to drain?
  5. How do I measure the backlog inside MQTT Engine?
  6. Can one node be stuck while the client latency looks fine?
  7. Can MQTT Engine drop old data instead of buffering it?
  8. What is the fix that actually holds?
  9. Questions asked

The stale values were not coming from the broker — they had already been accepted by the gateway. MQTT Engine buffers incoming messages and processes each Edge node's traffic in order, so when one node floods the system, the queue keeps feeding tags and the Perspective screens bound to them long after that node disconnects or the broker shuts down. In the reported incident, an Edge of Network node published NBIRTH and DBIRTH as fast as its CPU allowed for at least half an hour, screens showed data at least an hour old, and the display kept advancing even with the broker process stopped. The fix is a sequence, not a single action: correct the node's publishing configuration, measure the queue with the module's latency tags, and restart the module only after the cause is dead, to clear what it already built.

Why do the screens keep changing after the broker is shut down? #

Because the messages were already inside the gateway before the broker stopped: MQTT Engine accepts, queues and then processes each Edge node's messages in order, so a queue built during the flood keeps feeding tags — and the Perspective screens bound to them — long after ingress stops.

MQTT Engine does not write values the moment they arrive. It maintains an ordered processing path for each Edge node and works through that node's messages one at a time, so the rate at which tags update is the module's processing rate, not the network's arrival rate. During the flood, arrivals outran processing and the difference piled up as pending work. When the broker went down, arrivals stopped and processing continued, so each completed message pushed an old timestamp onto a live tag.

That also explains the playback signature: tag timestamps advanced faster than one timestamp-second per wall-second, which no live publisher at that tag can produce. A broker restart would not have changed it either way, because the work was already on the gateway side of the connection.

Where in the path is the backlog actually sitting? #

Between arrival and completed processing, inside the MQTT Engine module — not on the broker and not in Perspective; the proof in the incident was that values kept advancing after both the publishing node was disconnected and the broker process was shut down, which leaves only the gateway-side queue.

Work the four links in order; in the incident, activity continuing at the third row after the first two were dead was the locating evidence.

Path segment Reading to take Continued activity means Next check
Edge node to broker Publisher connection state and outgoing message types A connected publisher may still be generating the birth flood Inspect the node's configuration and its birth-trigger conditions
Broker to MQTT Engine The Engine client's connection state and incoming message counts Messages are still entering the gateway; ingress has not stopped Stop the source, then confirm the counts stay at zero
MQTT Engine to Ignition tags Tag values and their timestamps Changes after confirmed ingress loss put the pending work inside the module Trend timestamp progression against wall clock
Ignition tags to Perspective Direct tag reading versus the value on screen A stale screen over a current tag is a binding problem, not a queue Inspect the Perspective binding path

Disconnecting the Edge node stops new publications from that node but does not recall messages already accepted, and shutting the broker down discards nothing the module has received. Both facts were true at once here, which is why the path table, not intuition, should pick the culprit.

Is the node still publishing, or is the gateway draining a backlog? #

Check both ends with timestamps: a node that is still connected can still be flooding, and messages already accepted keep draining after it stops — if tag timestamps advance through old values while you have confirmed no traffic is arriving, what you are watching is drain, not live data.

Confirm ingress loss before interpreting anything downstream: read the broker's connection log or the switch counters between node and broker, note the wall-clock time traffic stopped, and compare it with the times the Engine-side tags moved. Treat connection state as weak evidence, because this same module can report an edge node as online after it drops, as described in why MQTT Engine shows online status after an edge node drops.

Birth messages are the expensive part of this traffic. An NBIRTH or DBIRTH declares the node or device and carries the metric definitions a subscriber needs to interpret everything that follows, so each one is a full processing job rather than a value refresh. A node configured to republish them continuously — in the incident, at whatever rate its own CPU sustained — creates work far out of proportion to its wire size.

Example: how long does an hour of buffered data take to drain? #

Divide the backlog's age by the drain multiple your trend shows: 60 minutes of buffered message-time draining at 3 timestamp-seconds per wall-second takes 60 / 3 = 20 minutes of wall clock. If the multiple is 1.5, the same backlog needs 40 minutes; at 6 it clears in 10 minutes.

Three inputs decide it: the backlog age, the drain multiple, and how stale the screens may get before operations must be told.

  • Backlog age: the distance tag timestamps trail wall clock at the moment ingress stops. Read it from the tags themselves, not from memory of when the trouble started.
  • Drain multiple M: how many timestamp-seconds advance per wall-second while the queue drains. Any value above one proves drain; trend the progression to get the real number instead of assuming 3.
  • Tolerance: the staleness your display audience accepts.

The arithmetic is one division: drain time = backlog age / M. At M = 3, a 60-minute backlog clears in 60 / 3 = 20 minutes of wall clock; at M = 1.5 it needs 40 minutes, so halving the multiple doubles the wait.

M is only valid after ingress stops. While the node still floods, processing can be fully consumed by new arrivals and the backlog never shrinks at all. Two decisions follow: inside tolerance, let it drain and keep the data; outside tolerance, restart the module and accept the gap — but only after the publisher is fixed, since a restart while it still floods rebuilds the queue immediately. While any drain runs, the screens age by the minute, so treat them as untrusted for operational decisions until the timestamps catch up.

How do I measure the backlog inside MQTT Engine? #

Set the client-level latency tags: [MQTT Engine]Engine Info/MQTT Clients/SERVER_NAME/Enable Latency Check to true, then trend [MQTT Engine]Engine Info/MQTT Clients/SERVER_NAME/Message Processing Latency in milliseconds — replace SERVER_NAME with your configured client's name. Climbing latency during the flood and falling latency after the source is corrected places the queue in the module.

  1. Identify which configured MQTT client in MQTT Engine carries the affected node's traffic.
  2. Set [MQTT Engine]Engine Info/MQTT Clients/SERVER_NAME/Enable Latency Check to true. It ships disabled because the calculation consumes resources.
  3. Trend [MQTT Engine]Engine Info/MQTT Clients/SERVER_NAME/Message Processing Latency in milliseconds alongside gateway CPU, incoming message counts, and the affected node's timestamp progression.
  4. Read it as sampled arrival-to-fully-processed time, taken roughly every couple of seconds: not a per-message value, not the age of the data, and not a queue length. Enabled, it reads zero or greater.
  5. Turn the check back off when the diagnosis is done.

A reading that climbs with the flood and falls after the fix confirms the mechanism end to end. A reading that stays low while one node's tags remain stale does not clear the system — the next section is the reason why.

Can one node be stuck while the client latency looks fine? #

Yes. MQTT Engine preserves message order for each Edge node by funneling that node's messages through a single processing thread, so one slow node can lag badly while the sampled client-wide latency, dominated by the fast majority, still reads low.

The ordering rule is the mechanism: spare processing capacity elsewhere never lets one node's queue overtake another's. In a workload where 99% of messages process quickly, most latency samples land low even while the slow 1% ages without limit, so a healthy-looking client reading can hide exactly the node that is hurting you.

The check that catches it is per node, not per client: compare the affected node's tag timestamps with timestamps from other nodes on the same MQTT client. Only the flooding node lagging points at that node's publishing configuration. Unrelated nodes also going stale points at shared gateway resources under the flood's load — the publisher is still the first fix, but check what else the gateway carries. Everything stale with high latency is a client-wide backup, and the drain arithmetic and restart decision in the example above apply.

One reported incident does not make every stale node a publishing fault. The per-node timestamp comparison is what turns the symptom into a verdict.

Can MQTT Engine drop old data instead of buffering it? #

No documented Engine-side switch caps or drops the inbound queue, so the control point is the publisher; the documented bound sits on the publishing side, in MQTT Transmission's store-and-forward queue, which holds tag-change events for an edge node within a documented capacity.

Before you clear that publishing-side queue by bouncing the session, read why buffered Sparkplug B data is rejected after a reconnect — a bounced session has its own failure mode.

So the drop-versus-buffer choice is made at the source twice. In the node's configuration: births on session establishment and genuine state changes only, with periodic values sent as ordinary data messages, so no flood fills any queue in the first place. In your acceptance of restarts: for tags that exist to show operators current state, a restart that discards stale playback is the better outcome, while tags feeding a historian that must not lose samples argue for draining and for the tolerance arithmetic above.

What is the fix that actually holds? #

Fix the publishing node first, then restart the module. Correct whatever published NBIRTH and DBIRTH continuously, confirm births fire only on session establishment and genuine state changes, and watch ingress stay at zero; a restart now clears the leftover queue without rebuilding it. Restarting before the fix just empties today's queue into the same fault.

CPU confirms the diagnosis only as a correlation: in the reported incident the Ignition gateway sat at 40% CPU during the flood against a normal 5–15% and fell when the node was corrected. Trend that against incoming message activity rather than treating any percentage as an overload threshold, because overall CPU says nothing about one node's ordered path. If the flood came from a node that cycles and re-declares itself rather than a one-time mistake, the same configuration defect drives why a Sparkplug edge node stays stuck in a rebirth loop.

The decision for each case:

  • Tags and screen stale together, ingress confirmed stopped — a drain in progress: fix the publisher, compute the drain time, restart if it exceeds tolerance.
  • Screen stale, tag current — a binding problem in Perspective; leave MQTT Engine out of it.
  • Client latency low, one node stale — per-node ordering; compare timestamps across nodes before trusting the latency tag.
  • Node still flooding — nothing downstream holds; the queue will not shrink until the publisher stops.

Leave the system better instrumented than you found it: latency baselines captured at commissioning and per-node timestamp alarms turn the next flood from a mystery into an alert.

Questions asked

Does restarting the MQTT Engine module lose the buffered messages?

Yes. A restart clears the pending queue instead of delivering it, so the backlog values are dropped, not replayed. Expect a gap in the tag history across the flood and the drain period, because those values were never written to the tags. For tags that exist to show operators current plant state that is usually the better trade, but tell the people reading the historian about the gap so they do not mistake it for a process upset.

Is there a tag that marks values as coming from the buffer?

None in the documented Engine Info tags: the latency check measures module processing time, not the age of individual values. Judge staleness from the tag timestamps themselves, because during a drain they trail wall clock by the backlog age and advance faster than it. If a screen needs a hard staleness guard, compare the tag timestamp against gateway time and alarm on the difference rather than waiting for the module to flag anything.

How many messages per second can MQTT Engine process before it backs up?

There is no single published figure that decides it: throughput depends on message size, metric counts per birth, gateway hardware and everything else the gateway runs. Build your own baseline during commissioning. Enable the latency check, load the system with your worst expected publisher behavior, and record the latency you see. Alarm on movement away from that baseline rather than on any absolute figure, and re-baseline after major gateway changes.

What bounds the buffering on the publishing side?

MQTT Transmission's store-and-forward queue is limited by Edge Node Tag Capacity, documented as the maximum number of tag change events stored for each Edge Node, applying to Edge Node level tags. The receiving module has no documented equivalent cap, which is why flood prevention has to be built into the publisher's configuration rather than bolted onto the consumer.

Keep reading

  • Troubleshooting

    Fixing MQTT cloud broker data not reaching SCADA tags

    Get the gate right first: MQTT over TLS belongs on port 8883, with the TLS mode and client identity the broker actually requires. An independent client such as MQTT Explorer on the same PC proves only its own settings, not the driver's. If the driver cannot perform the service-specific handshake Azure IoT Hub needs, no tag mapping will ever fill.

    Edge computing and IIoT

  • How-to

    MQTT store and forward backfill after a connection outage

    Yes. Tag data collected on the edge during the outage fills the server gap after reconnection, but only when Store and Forward is enabled in MQTT Transmission on the edge and history is enabled on the receiving MQTT Engine tags. Matching historian database names on both systems does nothing.

    Edge computing and IIoT

  • Troubleshooting

    Trace Ignition Edge MQTT values that only update on refresh

    Values that appear only after a refresh mean the Edge transmitter publishes nothing on its own: the forced republish masks a stalled change-driven path. Set a 10,000 ms scan rate with a 0.00000001 deadband and a moving signal publishes at the scan rate, then verify by counting 6 updates per minute with no refresh anywhere. Trace tag value and timestamp at each hop to find where it stops.

    Edge computing and IIoT