Skip to content

MQTT 3.1.1 implementation - #582

Merged
jfallows merged 17 commits into
aklivity:feature/mqtt-kafkafrom
bmaidics:3.1.1_impl
Dec 1, 2023
Merged

jfallows merged 17 commits into
aklivity:feature/mqtt-kafkafrom
bmaidics:3.1.1_impl

Conversation

@bmaidics

@bmaidics bmaidics commented Nov 20, 2023 •

Copy link
Copy Markdown
Contributor

No description provided.

@bmaidics bmaidics added the enhancement New feature or request label Nov 20, 2023
@bmaidics bmaidics self-assigned this Nov 20, 2023
@bmaidics bmaidics linked an issue Nov 20, 2023 that may be closed by this pull request

@jfallows jfallows left a comment

Copy link
Copy Markdown
Contributor

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.

@jfallows jfallows left a comment •

Copy link
Copy Markdown
Contributor

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.

@jfallows jfallows left a comment

Copy link
Copy Markdown
Contributor

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.

@jfallows
jfallows merged commit 3dbb69f into aklivity:feature/mqtt-kafka Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mqtt protocol v3.1.1

2 participants