-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
MQTT5 support for netty-codec-mqtt #10483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can one of the admins verify this patch? |
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectReturnCode.java
Outdated
Show resolved
Hide resolved
fc5dd1b
to
714d09e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes and do check for API breakage.
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttCodecUtil.java
Outdated
Show resolved
Hide resolved
...mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttMessageIdAndPropertiesVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPubReplyMessageVariableHeader.java
Outdated
Show resolved
Hide resolved
...qtt/src/main/java/io/netty/handler/codec/mqtt/MqttReasonCodeAndPropertiesVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttSubscriptionOption.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttSubscriptionOption.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttUnsubAckPayload.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttUnsubAckPayload.java
Outdated
Show resolved
Hide resolved
example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have a closer look soon. That said you will need to fix all the API breakage
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnAckVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttDecoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttSubAckMessage.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttSubAckMessage.java
Show resolved
Hide resolved
...qtt/src/main/java/io/netty/handler/codec/mqtt/MqttReasonCodeAndPropertiesVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPublishVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPubAckMessage.java
Outdated
Show resolved
Hide resolved
a59e65c
to
95eb759
Compare
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttCodecUtil.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next round of review
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttCodecUtil.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttCodecUtil.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnAckVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPubReplyMessageVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttPublishVariableHeader.java
Outdated
Show resolved
Hide resolved
7d90e00
to
4df4ec7
Compare
@chrisvest this may be a good one for you to check as well to get more familiar with the code base :) |
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectVariableHeader.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttDecoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttDecoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttDecoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttEncoder.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttProperties.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttUnsubAckMessage.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttUnsubAckPayload.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttUnsubAckPayload.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/test/java/io/netty/handler/codec/mqtt/MqttCodecTest.java
Outdated
Show resolved
Hide resolved
@@ -295,8 +316,8 @@ public void testUnknownMessageType() throws Exception { | |||
final MqttMessage decodedMessage = (MqttMessage) out.get(0); | |||
assertTrue(decodedMessage.decoderResult().isFailure()); | |||
Throwable cause = decodedMessage.decoderResult().cause(); | |||
assertTrue(cause instanceof IllegalArgumentException); | |||
assertEquals("unknown message type: 15", cause.getMessage()); | |||
assertTrue(cause instanceof DecoderException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new exception makes sense, but I wonder if it's an API change. I don't see a lot of docs around this, so maybe it's unspecified.
codec-mqtt/src/test/java/io/netty/handler/codec/mqtt/MqttCodecTest.java
Outdated
Show resolved
Hide resolved
6652e05
to
f577a8d
Compare
@netty-bot test this please |
Rebased to the fresh 4.1. |
@chrisvest looks like I can't trigger the bot. Could you trigger the tests, please? |
@netty-bot test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, but I don't know enough about the MQTT protocol to comment on the correctness of the implementation and how well it follows the spec.
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttSubscriptionOption.java
Outdated
Show resolved
Hide resolved
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttUnsubAckPayload.java
Outdated
Show resolved
Hide resolved
@netty-bot test this please |
@paul-lysak great work! Please just address comment of @johnou and than we are ready to go :) |
Motivation: MQTT Specification version 5 was released over a year ago, netty-codec-mqtt should be changed to support it. Modifications: Added more message and header types in `io.netty.handler.codec.mqtt` package in `netty-coded-mqtt` subproject, changed `MqttEncoder` and `MqttDecoder` to handle them properly, added attribute `NETTY_CODEC_MQTT_VERSION` to track protocol version Result: `netty-coded-mqtt` supports both MQTT5 and MQTT3 now.
@netty-bot test this please |
I strongly suggest to look at the improvements I have made for #10509 will try to look at this if possible |
That's a nice improvement. Better do it one by one, however, as doing the same thing in different PRs most likely will cause conflicts. |
@paul-lysak thanks a lot for all the hard work! |
Cool! Thank you and other reviewers for helping to keep up with Netty quality! |
Motivation: MQTT Specification version 5 was released over a year ago, netty-codec-mqtt should be changed to support it. Modifications: Added more message and header types in `io.netty.handler.codec.mqtt` package in `netty-coded-mqtt` subproject, changed `MqttEncoder` and `MqttDecoder` to handle them properly, added attribute `NETTY_CODEC_MQTT_VERSION` to track protocol version Result: `netty-codec-mqtt` supports both MQTT5 and MQTT3 now.
Great!! |
Motivation:
MQTT Specification version 5 was released over a year ago,
netty-codec-mqtt should be changed to support it.
Modifications:
Added more message and header types in
io.netty.handler.codec.mqtt
package in
netty-coded-mqtt
subproject,changed
MqttEncoder
andMqttDecoder
to handle them properly,updated examples in
netty-example
.Based on https://github.com/moquette-io/netty-mqtt5-codec.
Result:
netty-coded-mqtt
supports both MQTT5 and MQTT3 now.