RockteMQ-AI commented on issue #1288:
URL:
https://github.com/apache/rocketmq-clients/issues/1288#issuecomment-4806249104
## 🤖 AI Assessment — Feature Request
**Classification:** `type/enhancement`
**Component:** `java/client` — `PublishingMessageImpl` / `Encoding`
### Analysis
This is a valid feature request. Current code analysis confirms:
1. **Hardcoded encoding** — In `PublishingMessageImpl#toProtobuf()` (line
115), body encoding is hardcoded to `Encoding.IDENTITY`:
```java
.setBodyEncoding(Encoding.toProtobuf(Encoding.IDENTITY))
```
2. **Limited encoding support** — The `Encoding` enum only defines
`IDENTITY` and `GZIP`. No `ZSTD` option exists.
3. **No user configuration** — There is no API for users to specify the
desired body encoding when sending messages.
### Suggested Implementation Direction
To implement this feature, the following changes would be needed:
| Area | Change |
|------|--------|
| **Protobuf** | Add `ZSTD` to the `Encoding` enum in `.proto` definitions |
| **Encoding enum** | Add `ZSTD` to
`org.apache.rocketmq.client.java.message.protocol.Encoding` |
| **Compression** | Implement zstd compress/decompress utilities (similar to
existing GZIP handling) |
| **Message API** | Expose encoding configuration in the `MessageBuilder`
API |
| **PublishingMessageImpl** | Use the configured encoding instead of
hardcoded `IDENTITY` |
| **Consumer side** | Ensure `MessageImpl` correctly handles `ZSTD` body
decoding |
### Priority Assessment
This is a reasonable enhancement for users who need better compression
ratios (zstd typically offers better speed/ratio tradeoffs than GZIP). However,
it requires:
- Protocol-level changes (protobuf enum extension)
- Coordination with the broker/proxy side for zstd support
- Cross-language consistency (other client SDKs may need similar updates)
cc @apache/rocketmq-committers — your thoughts on this feature request?
--
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]