apache / rocketmq-clients

RocketMQ Clients - Collection of Client Bindings for Apache RocketMQ
https://rocketmq.apache.org/
Apache License 2.0
328 stars 215 forks source link

[Bug] rocketmq-clients/golang与rocketmq-clients/java对数据解压的实现方式不一致导致gzip解压数据出错 #667

Open Justin1210 opened 10 months ago

Justin1210 commented 10 months ago

Before Creating the Bug Report

Programming Language of the Client

Go

Runtime Platform Environment

linux

RocketMQ Version of the Client/Server

消息队列 RocketMQ 版、RocketMQ5.1.4

Run or Compiler Version

openjdk version "1.8.0_392"

Describe the Bug

当消息生产者生产的消息时经过gzip压缩处理后,使用rocketmq-clients/golang 下的SimpleConsumer进行消费时无法正常解压出消息的body, 调试发现调用解压数据的操作utils.GZIPDecode会有错误消息:“gzip:invalid header”输出。我尝试使用rocketmq-clients/java下的SimpleConsumer例子测试,发现可以正常消费消息解压出数据,也就是说java版实现压缩和解压的方式与go的并不相同这个是为什么?java压缩使用的是zlib,在go中使用compress/gzip按标准的gzip解压,为什么不让它一致呢? WechatIMG17

WX20240115-180435@2x

Steps to Reproduce

消息生产者使用rocketmq-client 4.8.0 去生产一条比较大的消息,消息的body大于compressMsgBodyOverHowmuch设定默认的值4K,然后久会触发压缩消息操作UtilAll.compress(body, this.zipCompressLevel),然后使用rocketmq-clients/golang 下的SimpleConsumer去消费这条消息,就出现错误了

What Did You Expect to See?

数据能正常解析出来

What Did You See Instead?

WechatIMG17

Additional Context

No response

zhenliemao commented 10 months ago

can i work on this?

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 30 days with no activity. It will be closed in 3 days if no further activity occurs.

lizhanhui commented 9 months ago

@zhenliemao You are welcome to work on this issue.

chendong0120 commented 7 months ago

Python has the same problem

chendong0120 commented 7 months ago

兄弟你的问题应该和我一样, 可以看一下 这个提交 https://github.com/apache/rocketmq-clients/pull/722