You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/04 02:53:29 UTC

[I] [BUG] Retain flag ignored — every PUBLISH stored as retained; zero-byte retained PUBLISH never deletes [shenyu]

Aias00 opened a new issue, #6849:
URL: https://github.com/apache/shenyu/issues/6849

   ## Description
   `TopicRepository.add(topic, message)` is called unconditionally for every inbound PUBLISH regardless of the retain bit (module-wide grep for `isRetain`/`retain` returns zero hits). A zero-byte retained PUBLISH should delete the retained message — that never happens.
   
   ## Location
   - `shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/Publish.java:55`
   - `shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/repositories/TopicRepository.java:34-37`
   
   ## Impact
   Non-retained messages are persisted and redelivered to future subscribers as if they were retained (via `Subscribe.sendSubMessage` at `Subscribe.java:72-77`, which sends with `retain=true`). Violates MQTT-3.3.1.
   
   ## Suggested fix
   Read `msg.fixedHeader().isRetain()`; only call `TopicRepository.add` when retain is true; on a zero-byte retained PUBLISH, call `TopicRepository.remove(topic)`.
   


-- 
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: notifications-unsubscribe@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Retain flag ignored — every PUBLISH stored as retained; zero-byte retained PUBLISH never deletes [shenyu]

Posted by "wy471x (via GitHub)" <gi...@apache.org>.
wy471x commented on issue #6849:
URL: https://github.com/apache/shenyu/issues/6849#issuecomment-5243101190

   /assign


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Retain flag ignored — every PUBLISH stored as retained; zero-byte retained PUBLISH never deletes [shenyu]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6849:
URL: https://github.com/apache/shenyu/issues/6849#issuecomment-5174057250

   👋 Hello @Aias00
   
   A new issue has been opened by @Aias00:
   - **Title**: [BUG] Retain flag ignored — every PUBLISH stored as retained; zero-byte retained PUBLISH never deletes
   - **Link**: https://github.com/apache/shenyu/issues/6849
   
   Please review when you have time. Thank you! 🙏


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Retain flag ignored — every PUBLISH stored as retained; zero-byte retained PUBLISH never deletes [shenyu]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6849: [BUG] Retain flag ignored — every PUBLISH stored as retained; zero-byte retained PUBLISH never deletes
URL: https://github.com/apache/shenyu/issues/6849


-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org