rocketmq-clients icon indicating copy to clipboard operation
rocketmq-clients copied to clipboard

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

Open Justin1210 opened this issue 2 years ago • 6 comments

Before Creating the Bug Report

  • [X] I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • [X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

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

Justin1210 avatar Jan 15 '24 10:01 Justin1210

can i work on this?

zhenliemao avatar Jan 18 '24 08:01 zhenliemao

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.

github-actions[bot] avatar Feb 18 '24 00:02 github-actions[bot]

@zhenliemao You are welcome to work on this issue.

lizhanhui avatar Feb 18 '24 04:02 lizhanhui

Python has the same problem

chendong0120 avatar Apr 08 '24 03:04 chendong0120

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

chendong0120 avatar Apr 08 '24 07:04 chendong0120