Proper way to reset offset for a given GroupId
See original GitHub issueDescription
I need to be able to “rewind” a consumer to the beginning of a topic and re-process existing messages. Is this properly supported?
I’m using the following code, but am not getting the expected result.
foreach (var topicPartition in Consumer.Assignment)
{
Consumer.Assign(new TopicPartitionOffset(topicPartition, Offset.Beginning));
}
I’ve tried both .Seek() and .Assign() in the code above.
What is the proper way of resetting the offset on a per-group basis?
Checklist
- [1.0.1.1 ] Confluent.Kafka nuget version.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Spring Kafka - How to reset offset to latest with a group id?
Another way, we can always consume lastest message without commit group offset , by specify properties value with {"enable.auto.commit:false", " ...
Read more >How to change or reset consumer offset in Kafka? - DIGIT Core
In this tutorial, we will go through the step by step process to reset the offset of the Kafka consumer group.
Read more >How to reset consumer offsets in Apache Kafka
Next, you click the edit (pencil) icon next to the offset value in the affected consumer. Then you change the offset to the...
Read more >Unable to reset offset for a single partition - Java Clients
offset.reset , I'm trying to explicitly reset the offset for each consumer, when it gets a state partition assigned. I tried calling ....
Read more >Kafka Consumer Auto Offset Reset
reset set to latest, it does not consume the messages, and has no valid offset set. This is reflected in the CURRENT-OFFSET value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW This appears to be working for me with ver 1.3.0:
This appears to be the suggested code:
Which would work about 50% of the time, with the other half throwing an “erroneous” exception.