Skip to content

[BUG] Connect rejects MQTT 3.1.1 (level 4) and 5.0 — only legacy 3.1 accepted #6839

Description

@Aias00

Description

Connect.allowedProtocolVersion compares equality to MqttVersion.MQTT_3_1.protocolLevel() (level 3) only. Level 4 (MQTT 3.1.1) and level 5 (MQTT 5.0) are refused with CONNECTION_REFUSED_UNACCEPTABLE_PROTOCOL_VERSION. MQTT 3.1.1 has been the standard since 2014, so virtually every modern MQTT client (which defaults to 3.1.1) is rejected; the broker is effectively unusable for standard clients.

Location

  • shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/Connect.java:91

Impact

Virtually all modern MQTT clients rejected at CONNECT; broker only accepts legacy 3.1.

Suggested fix

Accept MqttVersion.MQTT_3_1_1.protocolLevel() (and consider 5.0).

Related existing

Distinct from MQTT-01 (#6637, missing return after protocol-version rejection). (Secondary: the missing return at Connect:56-57 after rejection is already tracked by MQTT-01.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions