confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
2.78k stars 847 forks source link

Question: Configure consumer to ignore any commited offsets and start always from autooffsetreset position #2202

Closed JBastiaan closed 3 months ago

JBastiaan commented 3 months ago

Description

I need to configure one of my clients topics consumers to:

However the current consumer is live and has already committed offsets. Now is there a way for the .net client to somehow ignore or reset these offsets so it will start always at the autooffsetreset position?

JBastiaan commented 3 months ago

I tried using the cli tool: kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --topic <topic_name> --reset-offsets --to-earliest --execute, however that will not cause the consumer to honor the autoffsetreset configuration, instead it will simply start from offset 0. And from what i can see there is no option to pretend there was never any committed offsets.

JBastiaan commented 3 months ago

Figured it out eventually that kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --delete will do the trick