Skip to content
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

Merged
merged 17 commits into from
Dec 1, 2023
Merged

Conversation

bmaidics
Copy link
Contributor

@bmaidics bmaidics commented Nov 20, 2023

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
Copy link
Contributor

@jfallows jfallows left a 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.

Copy link
Contributor

@jfallows jfallows left a 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.

Copy link
Contributor

@jfallows jfallows left a 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.

@jfallows jfallows merged commit 3dbb69f into aklivity:feature/mqtt-kafka Dec 1, 2023
3 checks passed
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