Repository navigation
fix(binding-mqtt-kafka): advertise maximum qos when qos 2 publish is disabled - #3136
Merged
jfallows merged 7 commits intoNov 12, 2026
Conversation
This was referenced Nov 12, 2026
jfallows
force-pushed
the
fix/3130-mqtt-kafka-connack-maximum-qos
branch
from
November 12, 2026 19:41
b91c2bb to
15afd0c
Compare
…h is disabled Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
…ertise it from server Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
…n reply Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
… reply and stop deriving client subscribe qos max from connack Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK
jfallows
force-pushed
the
fix/3130-mqtt-kafka-connack-maximum-qos
branch
from
November 12, 2026 20:54
15afd0c to
b50dee7
Compare
This was referenced Nov 12, 2026
fix(binding-mqtt-kafka): apply qos and no local conditions to retained replay on filter change
#3159
Merged
Merged
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
The MQTT server built the CONNACK Maximum QoS property from
subscribeQosMaxonly.mqtt-kafkaalways reportssubscribeQosMaxas 2, so the property was never sent even when QoS 2 PUBLISH is disabled byzilla.binding.mqtt.kafka.publish.qos.max,options.publish.qosMax, or a route whosewith.messagesuses${params}. A QoS 2 PUBLISH was then rejected with 0x9B although the client was never told the limit.MQTT 5.0 [MQTT-3.2.2-9]: a Server that does not support QoS 1 or QoS 2 PUBLISH packets MUST send Maximum QoS in the CONNACK with the highest QoS it supports. The property limits what the client may PUBLISH; subscription QoS is downgraded in the SUBACK, so it is not part of this value.
Changes:
MqttServerFactory: the CONNACK Maximum QoS is the per-connectionpublishQosMax(from the session BEGIN extension), omitted when 2. The Will QoS is rejected with 0x9B (QoS not supported) both at CONNECT, against the configured maximum, and again when the application's session reply arrives, against the reply'spublishQosMax, ending the session cleanly so no Will is delivered. The now-unusedsubscribeQosMaxfield is removed. MQTT 3.1.1 behavior is unchanged.MqttClientFactory: the Maximum QoS in the remote CONNACK limits the client's own PUBLISH, so it is reported to the application aspublishQosMax;subscribeQosMaxis no longer derived from it and is the constant 2.mqtt:matchBeginEx(session) now enforcespublishQosMaxwhen a script specifies it. It was silently ignored before, so scripts asserting it were vacuous.Fixes #3130
Stack
fix/3129-mqtt-per-connection-limitsdevelopfix/3130-mqtt-kafka-connack-maximum-qosfix/3129-mqtt-per-connection-limitsfix/3131-mqtt-kafka-message-expiry-secondsfix/3132-mqtt-kafka-retained-tombstonefix/3133-mqtt-v4-clean-session-persistenceTest evidence
Tests were committed first. Against
develop(before the fix) the new binding-mqtt ITs failed:shouldConnectWithPublishMaximumQos1,shouldConnectWithPublishMaximumQos0andshouldRejectWillQos2WhenPublishMaximumQos1inserver.v5.ConnectionIT. The Will check at the session reply was added test-first as well:shouldRejectWillQos2WhenSessionReplyPublishMaximumQos1fails without the check (CONNACK is not 0x9B) and passes with it../mvnw clean verify -am -pl specs/binding-mqtt.spec,runtime/binding-mqtt,specs/binding-mqtt-kafka.spec,runtime/binding-mqtt-kafkapasses (BUILD SUCCESS, with checkstyle, license and jacoco checks) after the fix and the rebase onto #3135.New scripts:
connect.publish.maximum.qos.1,connect.publish.maximum.qos.0(the application script setssubscribeQosMax(2)and only variespublishQosMax),connect.will.reject.will.qos.2.publish.maximum.qos.1, andconnect.will.reject.will.qos.2.session.reply.publish.maximum.qos.1(the application reads the Will before replying, so only the reply can lower the limit).session.publish.qos.max.1,session.publish.qos.max.0, run through the real proxy withoptions.publish.qosMax1 and 0 and with a${params}route.Enforcing
publishQosMaxin the matcher exposed these disagreements, each resolved by review:publishQosMax(2); the implementation never set it. Implementation fixed (MqttClientFactory).connect.delegate.connack.propertiesandsession.will.message.retainassertedsubscribeQosMax(0)for a CONNACK Maximum QoS of 0; they now assertsubscribeQosMax(2)andpublishQosMax(0).publish.reject.qos2server script repliedpublishQosMax(2), but the proxy gives 1 for both a${params}route andat_least_once; the client script already expected 1. Script fixed.session.subscribeandsession.reject.non.compacted.sessions.topicasserted 2 while their ITs run with a lowered limit (the Kafka scripts open no meta streams). Scripts now assert 1, and the duplicate@Configure(PUBLISH_MAX_QOS_NAME)with conflicting values on those two test methods is reduced to one.Notes and follow-ups
mqtt-kafkapublish limit is binding-wide: one route using${params}lowers QoS 2 for every route. Lazy QoS 2 setup per resolved topic removes the dependence on routes; tracked in mqtt-kafka: support lazy QoS 2 setup when the messages topic is resolved at PUBLISH #3148.binding-mqttandmqtt-kafkaare never run against each other in one engine by the ITs, so the Will rejection at the session reply is tested against a mock application that replies after the Will data, not against the real proxy.🤖 Generated with Claude Code
https://claude.ai/code/session_01SiHVoXuc5cy4391QVRVKbK