-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Master code reset consumer offset cause program exit #759
Comments
@maixiaohai hello,can you check this problem. i think the json is not the same cause the parse problem. what is your fastjson version |
more context: see rocketmq-client-go/internal/model_test.go Lines 407 to 422 in 82dcf51
|
@WJL3333 Thanks for your report, Could you have any idea for fixing this? |
@wenfengwang i think the json decode method cause this problem. the current json here is different from my rocketmq cluster, fastjson-1.2.76.jar i wonder if there is some special config for json serialization? if we can find why json is different, may be use different json lib in rocketmq or different fastjson version? the fix is apperent. |
We use Gson internal, can you help fix this? |
yes, but should we just follow the fastjson schema, and change the origin gson format? @maixiaohai @wenfengwang |
Yeah, fastjson format is original currently. RMQ server use fastjson to encode and decode as default. |
yes, i agree with you. the non-standard json schema is very annoying when port some admin interface from java to go. |
Please describe the issue you observed:
start local RocketMQ cluster
use example/consumer/simple/main.go start a consumer.
use ./mqadmin resetOffset tool to reset offset.
consumer process exit with.
INFO[0005] receive reset consumer offset request... broker="127.0.0.1:30931" consumerGroup=groupB timestamp=631123200000 topic=topicB
panic: runtime error: index out of range [1] with length 1
goroutine 113 [running]:
github.com/apache/rocketmq-client-go/v2/internal.(*ResetOffsetBody).Decode(0xc000461d20, {0xc00040c100, 0xfd, 0xfd})
/Users/bytedance/github/rocketmq-client-go/internal/model.go:309 +0xa45
github.com/apache/rocketmq-client-go/v2/internal.GetOrNewRocketMQClient.func5(0xc000416a80, {0x14ed5c8, 0xc0003260c0})
/Users/bytedance/github/rocketmq-client-go/internal/client.go:303 +0x3f8
github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).processCMD.func2()
/Users/bytedance/github/rocketmq-client-go/internal/remote/remote_client.go:207 +0x94
github.com/apache/rocketmq-client-go/v2/primitive.WithRecover(0xc000421ef0)
/Users/bytedance/github/rocketmq-client-go/primitive/base.go:100 +0x47
created by github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).processCMD
/Users/bytedance/github/rocketmq-client-go/internal/remote/remote_client.go:206 +0x378
Exiting.
Please tell us about your environment:
mac local
master client-go code.
rocketmq broker with fastjson-1.2.76.jar
Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
the test code in decode ResetOffsetBody json format is different from mine
mine from rocketmq broker response rpc
any different from fastjson config ?
The text was updated successfully, but these errors were encountered: