wy471x opened a new pull request, #6913: URL: https://github.com/apache/shenyu/pull/6913
Store the granted qos per subscriber channel in SubscribeRepository and allocate a packet id from each subscriber's own id space when fanning out publishes, instead of hard-coding AT_MOST_ONCE and reusing the publisher's packet id for every subscriber. <!-- Describe your PR here; e.g. Fixes #issueNo --> <!-- Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request. --> Make sure that: - [X] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide). - [X] You submit test cases (unit or integration tests) that back your changes. - [X] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`. ## Summary Fixed MQTT broker→subscriber fan-out to respect granted QoS and per-subscriber packet IDs. Changes - SubscribeRepository — now stores topic → Map<Channel, MqttQoS> instead of topic → List<Channel>; keeps the max QoS for overlapping subscriptions and ignores FAILURE subscriptions. - MqttPacketIdGenerator (new) — allocates packet IDs 1–65535 (wrapping) from each channel's own ID space; state cleaned up on Disconnect. - Publish.send — delivers at min(publishQoS, grantedQoS), assigns a per-subscriber packet ID for QoS > 0, and uses 0 for QoS 0, instead of hard-coding AT_MOST_ONCE and reusing the publisher's packet ID. Tests — 13 new unit tests covering the generator, repository, and publish fan-out behavior; all pass with checkstyle. close [#6850](https://github.com/apache/shenyu/issues/6850) -- 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]
