itxaiohanglover commented on PR #1304:
URL: 
https://github.com/apache/rocketmq-clients/pull/1304#issuecomment-5053630604

   Thanks for the thorough review — all four points adopted in 621b7af:
   
   1. **Encapsulation**: `PublishingSettings#setCompressBodyThresholdBytes` is 
now package-private, called only from `ProducerBuilderImpl` in the same package 
(tests go through a same-package helper).
   2. **Compression fallback**: GZIP output is now used only when it is 
strictly smaller than the original body; otherwise the message falls back to 
`IDENTITY`, so already-compressed/encrypted payloads are never inflated.
   3. **`sync()` clarification**: added an inline comment marking the threshold 
as a client-only setting that is never synced from the server.
   4. **Tests**: added the three suggested cases — exact-threshold boundary 
(`== threshold` compresses), incompressible random body falls back to 
`IDENTITY` deterministically, and an oversized incompressible body is rejected 
against `maxBodySizeBytes`. Also added a case documenting that a >4 MiB 
compressible body is accepted when its compressed form fits, matching the 
documented transport-size semantics.
   
   All 19 tests pass locally (`PublishingMessageImplTest` 7/7, 
`ProducerBuilderImplTest` 12/12).


-- 
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]

Reply via email to