In my case (testing read files in the manufacturer and consumption on the console, everything is only in local mode), I just saw this in the manufacturer's output:
offset.storage.file.filename=/tmp/connect.offsets
Therefore, I wanted to open it, but it is binary, with some subtle characters.
I deleted it (rename it also works), and then I can write to the same file and get the contents of the file from the user again. You must restart the console producer for it to take effect, because it tries to read the offset file, if it does not exist, create a new one so that the offset is reset.
If you want to reset without deleting, you can use:
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group <group-name> --reset-offsets --to-earliest --topic <topic_name>
You can check all group names:
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
and check the details of each group:
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group <group_name> --describe
In a production environment, this offset is controlled by zookeeper, so more steps (and cautions) are required. You can refer to this page:
https://metabroadcast.com/blog/resetting-kafka-offsets https://community.hortonworks.com/articles/81357/manually-resetting-offset-for-a-kafka-topic.html
Steps:
kafka-topics --list --zookeeper localhost:2181 kafka-run-class kafka.tools.GetOffsetShell --broker-list localhost:9092 -topic vital_signs --time -1