How to consume the consumed message from the kafka topic based on offset please provide example in confluent kafka python

0 votes
Suppose the consumer has consumed the messages and it is not committed yet and we have many such messages.

How to consume the consumed message from the kafka topic based on offset ? please provide example in confluent_kafka python.
Aug 8, 2020 in Apache Kafka by N Amit
• 120 points
3,604 views

1 answer to this question.

0 votes

Hi@Amit,

You can pass --offset keyword in your command. Here’s the command to read records from the second partition starting at offset 6.

$ kafka-console-consumer --topic example-topic --bootstrap-server broker:9092 \
 --property print.key=true \
 --property key.separator="-" \
 --partition 1 \
 --offset 6
answered Aug 10, 2020 by MD
• 95,440 points

Related Questions In Apache Kafka

0 votes
1 answer

How to reset the offset of messages consumed from Kafka?

The reset option only prints the result ...READ MORE

answered Jul 10, 2018 in Apache Kafka by Shubham
• 13,490 points
13,721 views
+1 vote
0 answers

how to delete the topic in kafka

How to stop Kafka server from crashing ...READ MORE

May 13, 2020 in Apache Kafka by sreeveena
• 150 points
1,086 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 10, 2018 in Apache Kafka by Shubham
• 13,490 points
3,337 views
0 votes
1 answer

How to delete a topic in Kafka 0.8.1.1?

Deleting topic isn't always working in 0.8.1.1 Deletion ...READ MORE

answered Sep 4, 2018 in Apache Kafka by nitinrawat895
• 11,380 points
1,545 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,067 views
0 votes
1 answer
0 votes
14 answers

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

To delete all the messages from a Kafka topic.  There are many approach ...READ MORE

answered Jun 19, 2020 in Apache Kafka by Pawan
• 380 points
226,735 views
0 votes
1 answer

How to read batch messages in confluent-kafka-python?

Hi@akhtar, You have to read the messages normally ...READ MORE

answered Apr 3, 2020 in Apache Kafka by MD
• 95,440 points
4,171 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP