[Enhancement] batch send support compression 批量发送支持压缩
Before Creating the Enhancement Request
- [X] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
by default, DefaultMQProducer will compress message body when body length is longer than 4k, but if send with batch(send( Collection<Message> msgs)), message body are not compressed.
it's better compress each message body when average length of messages body in the batch is larger than 4k.
默认配置下,用DefaultMQProducer的send方法发送单条消息,消息体大于4MB会被压缩。但该压缩不支持批量消息,即用send( Collection<Message> msgs)发送的消息,造成io和磁盘空间的浪费。
希望批量发送接口也能支持压缩
Motivation
trade cpu over disk io and space 使用cpu换取io和磁盘空间,一般的文本消息可以节约成本和提高效率。
Describe the Solution You'd Like
compress each message body when average length of messages body in the batch is larger than 4k. 批量的消息大时可以压缩消息,与单条类似的机制
Describe Alternatives You've Considered
- 使用方自行压缩消息体
- 批量消息一起压缩,包括header和body
Additional Context
No response
This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.
anyone care?