-
Notifications
You must be signed in to change notification settings - Fork 56
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
MQTT 3.1.1 implementation #582
Conversation
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.
Please use separate decodeXXXvN methods instead of switch statement to decode all versions in same decodeXXX method.
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttClientFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttClientFactory.java
Outdated
Show resolved
Hide resolved
...ty/zilla/specs/binding/mqtt/streams/network/v5/session.connect.payload.fragmented/server.rpt
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttClientFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.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.
We need separate decodePacketTypeV4
and decodePacketTypeV5
decoders.
Then decodeInitialType
should decode the generic connect fields to extract the version and switch to the either decodePacketTypeV4
or decodePacketTypeV5
.
There should be no need to keep checking the version in decodePacketTypeXX
methods.
Suggest having an Int2ObjectHashMap<MqttServerDecoder>
from version to decodePacketTypeXX
methods.
Then at the end of a decodeXXX method that is identical for both versions, instead of setting the decoder to decodePacketType
you can set it to decodePacketTypeByVersion.get(server.version)
instead.
For decodeXXX methods that are version specific, they can set the next decoder to decodePacketTypeV4
or decodePacketTypeV5
explicitly.
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/stream/MqttServerFactory.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.
Still need to apply decodePacketTypeVx
feedback.
No description provided.