How to rewind and see the previous offset in a section using the Kafka Go client

I am new to Kafka. I am currently experimenting with this "Channel Example" from Confluent Inc Github repo

From what I know, consumers are divided into groups. Each group has its own section shift. Let me say that I have 40 posts in a specific topic, call owner_commands. A consumer, belonging to a group of dogs, joins and begins to consume the 40 messages.

When I disconnected and reconnected this user, I noticed that messages are no longer displayed. It says that I reached the end of the file. However, if I join the cluster with another consumer who belongs to another group (say, a cat), I read these 40 messages again.

Do you know if there is a way that dog group users can rewind and play these messages again using the Kafka Go API. I looked at the source code of the Kafka Golang API, I could not find anything that tells me that I can rewind and look at a specific message in the past.

thank

+4
source share
1 answer

CommitOffsets , . .

CommitOffsets : http://docs.confluent.io/current/clients/confluent-kafka-go/index.html#Consumer.CommitOffsets

API, kafka-consumer-groups . Apache Kafka 0.11.

+1

Source: https://habr.com/ru/post/1684930/


All Articles