Skip to content
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

ConsumeFromLastOffset problem #958

Open
ckall opened this issue Nov 9, 2022 · 5 comments
Open

ConsumeFromLastOffset problem #958

ckall opened this issue Nov 9, 2022 · 5 comments

Comments

@ckall
Copy link

ckall commented Nov 9, 2022

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}),
}),
)

@ofttryaj
Copy link

I have the same question

@francisoliverlee
Copy link
Member

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

@ckall
Copy link
Author

ckall commented Mar 6, 2023

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

@francisoliverlee
Copy link
Member

my pleasure

@CoderReaper
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants