Repository navigation
fix(binding-mqtt-kafka): apply qos and no local conditions to retained replay on filter change - #3159
Merged
jfallows merged 2 commits intoNov 12, 2026
Conversation
…ed replay after filter change Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoUeJVyz2h4Ry96ndCG
…d replay on filter change Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoUeJVyz2h4Ry96ndCG
jfallows
force-pushed
the
fix/3153-mqtt-kafka-retained-replay-conditions
branch
from
November 12, 2026 22:38
17b29f8 to
5092eff
Compare
jfallows
changed the base branch from
fix/3133-mqtt-v4-clean-session-persistence
to
fix/3151-mqtt-retain-handling-1
November 12, 2026 22:38
This was referenced Nov 12, 2026
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a SUBSCRIBE adds filters to an existing session while the retained Kafka stream is still open,
KafkaRetainedProxy.doKafkaFlushbuilt its Kafka filters with only the topic headers. The begin path (newKafkaStream) also adds the NO_LOCAL condition and the per-QoS-level NOT conditions, so the flushed filters matched messages the begin path would have excluded. That breaks MQTT 5.0 [MQTT-3.8.3-3] (No Local messages MUST NOT be forwarded to the publishing connection) for retained messages published by the same client, and can deliver a retained message once per QoS-level stream.The issue was from reading the code only, so the first commit adds a failing scenario:
subscribe.filter.change.retain.no.local(mqtt and kafka sides, run byMqttIT,KafkaITandMqttKafkaSubscribeProxyIT). It holds the retained stream open, then adds a No Local filter, and expects the flushed filters to carryheaderNot zilla:localand the QoS NOTs. It failed against the existing code because the retained flush carried two bare filters.The fix extracts the begin path's condition building into
buildFilterConditionsand uses it from bothnewKafkaStreamand the retained flush, so there is one copy of the logic.Fixes #3153
Based on #3160's branch (
fix/3151-mqtt-retain-handling-1), stacked ondevelop. The base should be retargeted todevelopafter #3160 merges.Test evidence
specs/binding-mqtt-kafka.specverify: 238 ITs (MqttIT 106, KafkaIT 132) pass, 27 unit tests pass; the new scripts agree peer-to-peer.runtime/binding-mqtt-kafkaverifywith checkstyle and license on, build cache skipped: 137 ITs pass (MqttKafkaSubscribeProxyIT 61, MqttKafkaSessionProxyIT 36, MqttKafkaPublishProxyIT 40), 10 unit tests pass.MqttKafkaSubscribeProxyITmethod fails on the retained flush filters (no conditions); with the fix it passes.Not delivered / follow-ups
KafkaMessagesProxy.doKafkaFlush) already applies these conditions but keeps its own copy of the same code. It could reusebuildFilterConditions; left out to keep this diff small.🤖 Generated with Claude Code
https://claude.ai/code/session_01SiHVoUeJVyz2h4Ry96ndCG