rocketmq-client-go icon indicating copy to clipboard operation
rocketmq-client-go copied to clipboard

ConsumeFromLastOffset problem

Open ckall opened this issue 2 years ago • 5 comments

I have set ConsumeFromLastOffset (a new consumption group) when I use Rocketmq consumer to consume, but I still consume the old data after starting. I have seen the code in it. The first time I obtained the offset, it was 0. But I think Rocketmq go sdk needs - 1 to obtain the maximum offset. Do you encounter this situation and how to solve it


c, err := rocketmq.NewPushConsumer( consumer.WithCredentials(credential), consumer.WithNameServer([]string{endpoint}), consumer.WithNamespace(instanceID), consumer.WithGroupName(groupId), consumer.WithInstance(getInstanceName(topic)), consumer.WithAutoCommit(true), consumer.WithConsumerModel(consumer.Clustering), consumer.WithConsumeFromWhere(consumer.ConsumeFromLastOffset), consumer.WithConsumeMessageBatchMaxSize(1), consumer.WithTrace(&primitive.TraceConfig{ //TraceTopic: topic, GroupName: groupId, Access: primitive.Cloud, NamesrvAddrs: []string{endpoint}, Credentials: credential, Resolver: primitive.NewPassthroughResolver([]string{endpoint}), }), )

ckall avatar Nov 09 '22 08:11 ckall

I have the same question

ofttryaj avatar Dec 10 '22 06:12 ofttryaj

#886 had solved the problem, you can check it on master

francisoliverlee avatar Mar 06 '23 03:03 francisoliverlee

Thank you. I will close this issue after my experiment is successful

ckall avatar Mar 06 '23 03:03 ckall

my pleasure

francisoliverlee avatar Mar 13 '23 03:03 francisoliverlee

It seems that the issue is still not fixed, as the new consumer group is still consuming old message. with set :ConsumeFromLastOffset

CoderReaper avatar Apr 24 '23 08:04 CoderReaper