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

Since allow the consumer to disable auto-commit offsets, so how to commit offset manually? #1764

Closed
bglmmz opened this issue Jul 27, 2020 · 6 comments
Labels
stale Issues and pull requests without any recent activity

Comments

@bglmmz
Copy link

bglmmz commented Jul 27, 2020

Sarama Kafka Go
1.26.4 2.5.0 1.10.4

refer to the PR #1164.

I want to commit offsets manually, but I cannot find any API or sample? Could anyone give me a hand? Thanks!

@xwi88
Copy link

xwi88 commented Jul 30, 2020

Sarama Kafka Go
1.26.4 2.5.0 1.10.4
refer to the PR #1164.

I want to commit offsets manually, but I cannot find any API or sample? Could anyone give me a hand? Thanks!

sarama.NewConfig().Consumer.Offsets.AutoCommit.Enable = false

func MarkMessage(sess sarama.ConsumerGroupSession, msg *sarama.ConsumerMessage, metadata string) {
	sess.MarkMessage(msg, metadata)
}

So sorry, manually commit also failed.

@qiangmzsx
Copy link
Contributor

I am using v1.27.0 and have set up:

mqConfig.Consumer.Offsets.AutoCommit.Enable = true
	mqConfig.Consumer.Offsets.AutoCommit.Interval = 100* time.Millisecond

But sarama doesn't automatically submit the offset as expected.

@qiangmzsx
Copy link
Contributor

I am using v1.27.0 and have set up:

mqConfig.Consumer.Offsets.AutoCommit.Enable = true
	mqConfig.Consumer.Offsets.AutoCommit.Interval = 100* time.Millisecond

But sarama doesn't automatically submit the offset as expected.

I see, it still requires a manual process to submit, but the submissions are spaced out.

@Gypsying
Copy link

Gypsying commented Oct 19, 2020

Consumer.Offsets.AutoCommit.Enable = false

consumerGroupSession.ResetOffset(Topic, Partition, Offset, "")
consumerGroupSession.Commit()

i test the settings like that, but the kafka' CURRENT-OFFSET does't change,
i don't why, it seems not work...

@wclaeys @dnwe @d1egoaz @bai
Can you give some samples?
Thanks.

@ghost
Copy link

ghost commented Mar 16, 2021

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@ghost ghost added the stale Issues and pull requests without any recent activity label Mar 16, 2021
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
@dnwe
Copy link
Collaborator

dnwe commented Aug 24, 2023

Fixed by #1699

@dnwe dnwe closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and pull requests without any recent activity
Projects
None yet
Development

No branches or pull requests

5 participants