Aias00 opened a new issue, #6850: URL: https://github.com/apache/shenyu/issues/6850
## Description `SubscribeRepository.add(Channel, List<MqttTopicSubscription>)` stores only `channel`, throwing away `s.qualityOfService()`. `Publish.send` hard-codes `MqttQoS.AT_MOST_ONCE` for fan-out and uses `new MqttPublishVariableHeader(topic, packetId)` reusing the inbound publisher's `packetId` for every downstream subscriber. ## Location - `shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/Publish.java:120-121` - `shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/repositories/SubscribeRepository.java:56-62` ## Impact QoS 1/2 subscribers receive at-most-once delivery (no redelivery, no ack correlation). Reusing the publisher's packet ID across distinct subscriber channels corrupts each subscriber's in-flight window/ack correlation. Violates MQTT-3.6. ## Suggested fix Store per-subscriber QoS in `SubscribeRepository`; allocate a per-subscriber packetId from each subscriber channel's own id space; deliver at the granted QoS. ## Related existing Distinct from MQTT-03 (#6743, broker→publisher PUBREC direction) and MQTT-04 (#6744, ByteBuf leak) — this is the broker→subscriber fan-out direction. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
