Skip to content

MQTT: Keep connection open for authz failures#15201

Merged
michaelklishin merged 2 commits intomainfrom
mqtt-disconnect-unauthorized
Jan 2, 2026
Merged

MQTT: Keep connection open for authz failures#15201
michaelklishin merged 2 commits intomainfrom
mqtt-disconnect-unauthorized

Conversation

@ansd
Copy link
Copy Markdown
Member

@ansd ansd commented Jan 2, 2026

This PR supersedes #15123.
The first commit contains the changes in #15123 contributed by @iamdrq .
The second commit contains some refactoring.

iamdrq and others added 2 commits January 2, 2026 17:04
Adjust mqtt disconnect comment

Add a config option to toggle mqtt disconnect on unauthorized topic

mqtt.disconnect_on_unauthorized=true(defualt)
disconnect the clinet when publish or subscribe unauthorized topic.

mqtt.disconnect_on_unauthorized=false
subscribe unauthorized topic,
reply SUBACK(non-authorized) and send retained messages for the successfully subscribed topics and keep connection.
publish unauthorized topic,
MQTT v5 and QoS1 reply with PUBACK including an error reason code and keep connection,
MQTT v3 and QoS1 reply with PUBACK no error reason code and keep connection,
QoS0 drop silently and keep connection.

Add a config option to toggle mqtt disconnect on unauthorized topic

mqtt.disconnect_on_unauthorized=true(defualt)
disconnect the clinet when publish or subscribe unauthorized topic.

mqtt.disconnect_on_unauthorized=false
subscribe unauthorized topic,
reply SUBACK(non-authorized) and send retained messages for the successfully subscribed topics and keep connection.
publish unauthorized topic,
QoS1 reply with PUBACK(non-authorized)  and keep connection,
QoS0 drop silently and keep connection.
@michaelklishin
Copy link
Copy Markdown
Collaborator

Per discussion with David: a rabbitmq.conf.example will be updated together with the website.

@michaelklishin michaelklishin merged commit 9ca2a98 into main Jan 2, 2026
572 of 577 checks passed
@michaelklishin michaelklishin deleted the mqtt-disconnect-unauthorized branch January 2, 2026 19:14
@michaelklishin
Copy link
Copy Markdown
Collaborator

@iamdrq thank you for contributing.

michaelklishin added a commit that referenced this pull request Jan 2, 2026
michaelklishin added a commit that referenced this pull request Jan 2, 2026
(cherry picked from commit e1d147c)
michaelklishin added a commit that referenced this pull request Jan 2, 2026
michaelklishin added a commit that referenced this pull request Jan 2, 2026
MQTT: Keep connection open for authz failures (backport #15201)
mergify bot pushed a commit that referenced this pull request Jan 2, 2026
(cherry picked from commit e1d147c)
(cherry picked from commit 2b41b17)
michaelklishin added a commit that referenced this pull request Jan 2, 2026
michaelklishin added a commit that referenced this pull request Jan 3, 2026
MQTT: Keep connection open for authz failures (backport #15201) (backport #15203)
michaelklishin added a commit to rabbitmq/rabbitmq-website that referenced this pull request Jan 4, 2026
michaelklishin added a commit that referenced this pull request Feb 24, 2026
michaelklishin added a commit that referenced this pull request Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants