0

I need to create a Kafka setup where at the start of each day, all messages in a topic must get deleted and its offset reset to 0.

I have tried to do this by setting log.retention to 1 day but it didn't seem to work. I also ran kafka-delete-records. It did delete all the messages but kafka.tools.GetOffsetShell still gave me the latest offset. I want it to go to 0.

Also, I am not explicitly setting a consumer group. They are internal ones like _confluent-ksql-default_transient_929377247691956102_1560973030312. So I want the offset for the topic to be reset to 0 irrespective of the consumer group.

OneCricketeer
  • 126,858
  • 14
  • 92
  • 185
SRMara
  • 11
  • 4

1 Answers1

0

There is no way to reset the head offset of a topic in Kafka, except to delete the topic and create a new one with the same name.

You can also use the admin api to delete consumer groups.

Andrew Coates
  • 1,406
  • 1
  • 7
  • 13