Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3544 +/- ##
============================================
- Coverage 77.47% 75.88% -1.59%
- Complexity 3778 5282 +1504
============================================
Files 306 455 +149
Lines 12673 18078 +5405
Branches 1648 2265 +617
============================================
+ Hits 9818 13718 +3900
- Misses 2116 3250 +1134
- Partials 739 1110 +371
🚀 New features to boost your workflow:
|
…nses Complete the MQTT 5.0 support with what the connector could not express yet: * The last will message can be configured on the channel: will-topic and will-payload, plus will-content-type, will-response-topic and will-delay-interval for MQTT 5.0. The connector fails to start when only one of will-topic and will-payload is set, since the broker never sends such a will message. * The connect properties receive-maximum and topic-alias-maximum are exposed. * MqttMessage.ofResponse() builds the reply to an MQTT 5.0 request: it sends the message on the Response Topic carried by the request and copies its Correlation Data. MqttMessage also exposes getResponseTopic() and getCorrelationData(), so that replying does not require reading the metadata. Also fix the will-qos attribute, which was looked up as "will-qus" and so was ignored when customizing the options of a channel, and document the inbound and outbound metadata, which the documentation still declared as not provided. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The attribute has had no effect since the switch to Vert.x 5, whose MQTT client derives the will flag from the will message instead of exposing setWillFlag(). It stays accepted so that existing configurations keep working. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The `retain-handling` attribute travelled as a raw int down to the subscription, where Netty turned it into a RetainedHandlingPolicy: an out-of-range value failed late, inside the subscription, with a message naming neither the channel nor the attribute. Convert it once, when the channel is created, and carry the policy itself through SubscriptionOptions and the subscribe() methods of MqttClientSession. An invalid value now fails the channel immediately, saying which channel and which values are allowed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dometec
force-pushed
the
mqtt5_on_vertx51
branch
from
November 2, 2026 16:41
a4c2a0a to
c85d8f1
Compare
This branch has not been deployed
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.
Completes the MQTT 5.0 support that came with the Vert.x 5 switch (#3492) with the parts the
connector cannot express yet, and fixes two things found on the way.
Last Will and Testament
will-flag,will-qosandwill-retainwere the only will attributes, so the will messageitself — its topic and its payload — could not be configured at all: it could only come from a
custom
MqttClientSessionOptionsbean. The channel now accepts:will-topicandwill-payload, which must be set together — the connector fails to start whenonly one of them is set, since the broker never sends such a will message;
will-content-type,will-response-topicandwill-delay-intervalfor MQTT 5.0.While doing this:
will-flaghas had no effect since the Vert.x 5 client stopped exposingsetWillFlag()and derives the flag from the will message itself. It is now documented asignored, and kept accepted so that existing configurations keep working. Tell me if you would
rather deprecate or remove it.
MQTT 5.0 connect properties
receive-maximumandtopic-alias-maximumare exposed as channel attributes, next to theexisting
session-expiry-intervalandauthentication-method.Request/response
MQTT 5.0 carries request/response interactions with the
Response TopicandCorrelation Dataproperties.
MqttMessage.ofResponse(request, payload, qos[, userProperties])builds the reply:it sends the message on the topic the requester asked for and copies the correlation data, so the
requester can match the two.
MqttMessagealso exposesgetResponseTopic()andgetCorrelationData(), so replying does not require reading the metadata.Fixes
will-qoswas looked up as"will-qus"inMqttHelpers.customize(), so setting it on achannel that also uses a custom options bean had no effect.
retain-handlingtravelled as a rawintdown to the subscription, where Netty turned it intoa
RetainedHandlingPolicy: an out-of-range value failed late, inside the subscription, with amessage naming neither the channel nor the attribute, and the logs only showed
Subscription failed!. It is converted once, when the channel is created, and the policyitself is carried through
SubscriptionOptionsand thesubscribe()methods ofMqttClientSession.This changes two public signatures:
MqttClientSession.subscribe(..., RetainedHandlingPolicy retainHandling[, Integer subscriptionIdentifier])and theSubscriptionOptionsconstructorstake the policy instead of an
int. They were introduced by Switch to Vert.x 5 #3492 and, as far as I can see, arenot in a release yet, so this seemed the right moment — happy to keep the
intoverloadsinstead if you prefer.
Documentation
The connector documentation still declared that no inbound nor outbound metadata is provided,
which stopped being true when the v5 metadata landed. Both sections are written, together with the
protocol version, the last will and the request/response example.
Testing
mvn teston the MQTT module: 181 tests, no failure. The new ones are four onMqttMessage.ofResponse(...)inMqttMessageTestand three on theretain-handlingconversionin
MqttHelpersTest.About #3477
This PR targets
main, so it builds on the Vert.x 5 client. I am keeping mymqtt5branch,which is based on the 4.x line, and #3477 with it: I do not know whether
vertx-mqtt 4.xwill getMQTT 5.0 (vert-x3/vertx-mqtt#269) support, and until that is clear I would rather not drop the work that carries these features there.