How to reset the offset of messages consumed from Kafka?

0 votes

I have earlier consumed messages from Kafka. Now I want to reset the offset of consumer messages. I am using the following command:

kafka-consumer-groups.bat --bootstrap-server localhost:9092 --group group1 --reset-offsets --to-earliest --all-topics

So, I am getting output as the topic as, the partition number of topics and the new offset as 0.  But when I am executing the below command

kafka-consumer-groups.bat --bootstrap-server localhost:9092 --group group1 --describe

I can still see the old offset number. Anyone can help me in understanding how can I reset the offset?

Jul 9, 2018 in Apache Kafka by coldcode
• 1,980 points
1,207 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The reset option only prints the result of the operation, but to perform the operation, you need to add --execute parameter to the command

kafka-consumer-groups.bat --bootstrap-server localhost:9092 --group group1 --reset-offsets --to-earliest --all-topics --execute

Hope this helps!

answered Jul 9, 2018 by Shubham
• 12,230 points

Related Questions In Apache Kafka

0 votes
1 answer

What is the optimum number of producers to create in Kafka?

In general, a single producer for all ...READ MORE

answered Jul 10, 2018 in Apache Kafka by nitinrawat895
• 9,030 points
867 views
0 votes
1 answer

Explain to me the functionality of Kafka in a Big-Data Cluster

Let me explain to you about Apache ...READ MORE

answered Apr 30 in Apache Kafka by ravikiran
• 1,460 points
16 views
0 votes
0 answers

How to check pending messages in KAFKA topic?

Let say we have first_topic which has kafka_server_brokertopicmetrics_messagesin_total{instance="localhost:1120",job="kafka",topic="first_topic"}  ...READ MORE

May 2 in Apache Kafka by anonymous
37 views
0 votes
1 answer

Re-balancing error while reading messages from Kafka.

rebalance.backoff.ms defines the time for which Kafka ...READ MORE

answered Jul 9, 2018 in Apache Kafka by Shubham
• 12,230 points
263 views
0 votes
10 answers

Writing the Kafka consumer output to a file

System.out.println(String.valueOf(output.offset()) + ": " + new String(bytes, ...READ MORE

answered Dec 7, 2018 in Apache Kafka by Harsh
3,317 views
0 votes
1 answer

How to commit message offsets in Kafka for reliable data pipeline?

You can use auto.commit.enable to allow Kafka ...READ MORE

answered Jul 9, 2018 in Apache Kafka by Shubham
• 12,230 points
164 views
0 votes
1 answer

Is Kafka and Zookeeper are required in a Big Data Cluster?

Apache Kafka is one of the components ...READ MORE

answered Mar 22, 2018 in Big Data Hadoop by nitinrawat895
• 9,030 points
253 views
0 votes
1 answer

Getting error while connecting zookeeper in Kafka - Spark Streaming integration

I guess you need provide this kafka.bootstrap.servers ...READ MORE

answered May 24, 2018 in Apache Spark by Shubham
• 12,230 points
340 views
0 votes
11 answers

How can I delete all the messages from a Kafka topic?

To purge the Kafka topic, you need ...READ MORE

answered Jul 9, 2018 in Apache Kafka by Shubham
• 12,230 points
15,886 views
0 votes
1 answer

Not able to fetch messages from Kafka cluster

You need to add the hostname in ...READ MORE

answered Jul 9, 2018 in Apache Kafka by Shubham
• 12,230 points
354 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.