Skip to content

mqtt-kafka: retained replay on a later SUBSCRIBE omits the per-QoS and No Local conditions #3153

Closed

Description

@jfallows

Problem

In MqttKafkaSubscribeFactory the retained stream's flush path, used when the filter list changes (about 2410-2455 on develop at 1e802cb), builds its Kafka filters without the per-QoS-level NOT conditions and the NO_LOCAL condition that the begin path applies (about 2719-2765).

By reading the code, after a SUBSCRIBE that adds filters to an existing session:

  • a retained message can be replayed once per QoS-level stream, and
  • a subscriber that set No Local receives its own retained messages (MQTT 5.0 [MQTT-3.8.3-3]: No Local messages MUST NOT be forwarded to the publishing connection).

This was not run; the first step is a test that shows whether it fails.

Expected

The retained flush path applies the same conditions as the begin path, so a retained message is delivered once, at the right QoS, and never to the publishing client when No Local is set.

Test plan (test-first)

Spec scripts on both sides of mqtt-kafka: add a filter to an existing session when a retained message published by the same client is present, with No Local set and with several QoS levels. The first commit shows the failure. If the scenario does not fail, stop and report that instead of changing code.

Notes

Found by a clause-by-clause conformance audit, by reading the code only. Part of the MQTT conformance work under #512.

Activity

  1. self-assigned this
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions