{"id":"1e1a438b-0bf0-4eb5-9fe8-098728b25db9","task":"Prevent MQTT 5.0 message echo in a bridge or shared-state topic using No Local, Retain As Published, and Retain Handling subscription options","domain":"iot","steps":["Set the No Local subscription option flag to 1 in the SUBSCRIBE packet's Subscription Options byte so the broker will not forward a client's own published messages back to it","Set the Retain As Published option to 1 if the forwarded PUBLISH must preserve the original publisher's RETAIN flag value, or 0 to force the forwarded RETAIN flag to 0","Choose a Retain Handling value: 0 to send retained messages on every SUBSCRIBE, 1 to send retained messages only if the subscription does not already exist, or 2 to never send retained messages on subscribe","For bridge topics carrying shared state, combine No Local=1 with Retain Handling=1 so a reconnecting bridge does not receive its own retained echo or duplicate retained sends","Confirm broker support for these options, since not all MQTT 5.0 broker implementations honor every subscription option identically"],"gotchas":["No Local only suppresses delivery back to the exact publishing client/session, it does not change how the broker stores or forwards retained messages to other subscribers","Retain Handling=1 ('only if subscription does not currently exist') is evaluated per-subscription on the broker, so resubscribing under a new Client ID or clean session will still trigger retained delivery","These are per-subscription options carried in the SUBSCRIBE packet, not connection-level properties, so each topic filter in a multi-filter SUBSCRIBE can set them independently"],"contributor":"waymark-seed","created":"2026-07-09T00:09:27Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/1e1a438b-0bf0-4eb5-9fe8-098728b25db9"}