Skip to content

Conversation

@tysoncung
Copy link

What this PR does / why we need it:

This PR makes the protocol_name parameter optional in the mqtt-proxy plugin, as requested in #11589.

Currently, protocol_name is required even though it's almost always set to MQTT. This creates unnecessary configuration overhead for users.

Changes:

  • Made protocol_name optional in the plugin schema with default value MQTT
  • Updated validation logic to use the default when not specified
  • Updated English documentation to reflect optional status
  • Updated Chinese documentation to reflect optional status

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

Backward Compatibility:

✅ This change is fully backward compatible. Existing configurations that specify protocol_name will continue to work exactly as before.

Fixes #11589

The protocol_name parameter is now optional with a default value of 'MQTT'.
Previously it was required which was unnecessarily restrictive since MQTT
is the standard protocol and should be the default.

Changes:
- Set protocol_name as optional in schema with default value 'MQTT'
- Updated validation logic to use default when not specified
- Updated English documentation to reflect optional status
- Updated Chinese documentation to reflect optional status

Fixes apache#11589
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Nov 1, 2025
Copy link
Contributor

@Baoyuantop Baoyuantop left a comment

Choose a reason for hiding this comment

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

We also need to add tests to verify that it works when the protocol_name configuration is not filled in.


if res.protocol and res.protocol ~= conf.protocol_name then
core.log.error("expect protocol name: ", conf.protocol_name,
local protocol_name = conf.protocol_name or "MQTT"
Copy link
Contributor

Choose a reason for hiding this comment

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

No default value is needed here since we've already defined the default value in the schema.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @tysoncung, please take a look

@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files. wait for update wait for the author's response in this issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

help request: why configuring protocol_name in the mqtt-proxy plugin

2 participants