Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for mosquitto bridge versions 131 and 132 #106

Merged
merged 2 commits into from
Feb 22, 2021
Merged

Add support for mosquitto bridge versions 131 and 132 #106

merged 2 commits into from
Feb 22, 2021

Conversation

phil-mitchell
Copy link
Contributor

These protocols are for bridge mode of version 3. According to https://github.com/mqtt/mqtt.org/wiki/bridge_protocol these versions set the following properties:

  • ras = true
  • nl = true

@phil-mitchell phil-mitchell marked this pull request as draft February 20, 2021 19:58
@phil-mitchell phil-mitchell marked this pull request as ready for review February 20, 2021 20:17
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@phil-mitchell
Copy link
Contributor Author

I'm not sure it's clear that I don't have write access, so somebody will have to merge this if it's okay.

@mcollina mcollina merged commit cf29fd4 into mqttjs:master Feb 22, 2021
robertsLando added a commit to moscajs/aedes that referenced this pull request Mar 4, 2021
* feat(bridge): Support incoming mosquitto bridge connections

The incoming mosquitto bridge connections add 128 to the protocol
version to indicate ras=true and nl=true.

Support for this was added in mqtt-packet with
mqttjs/mqtt-packet#106

Subscriptions from these connections will have ras=true and nl=true

When publishing to these connections, aedes will now
copy the Packet and set retain to false only if ras is not true.

* clarify that Bridge Protocol is supported only for incoming connections

* Respond to some code review comments

* Move the retain flag clearing into the publish function

This allows all callers of subscribe to receive the retain flag
set to false unless explicitly requested by passing rap=true

* Revert previous behaviour change and adjust test

Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants