gerritjvv/kafka-fast

how does one delete the offset of a consumer group

Closed this issue · 5 comments

I am trying to reset the offset of the consumer group by using :use-earliest, so I can rebuild some state from old logs(event sourcing). How would I delete the offset already stored in redis from my program

Hi,

you'll need to go into redis using redis-cli and either flush-all or set the offsets to zero for the particular topic/offset combination.

to see the offset paths in redis just do ls $topic e.g mytopic

thanks

I thought offsets belong to consumers. I am actually trying to use kafka for event sourcing and I would need to reset the offset for a particular consumer and not for the entire topic to the beginning of a topic.

offsets are handled per topic/partition over a group of consumers. If you manage offsets per consumer instance, you won't have distributed consumption of the offsets but rather each consumer will pull the same data.

see https://github.com/gerritjvv/kafka-fast#create-fetch-producer for the lower down fetch api where you can pass in the offset you want to pull.

alright