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
1,180 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,060 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 9, 2018 in Apache Kafka by Shubham
• 13,480 points
10,203 views
0 votes
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
• 140 points
197 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
• 13,480 points
1,458 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
756 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 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,840 views
0 votes
0 answers
+1 vote
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
144,142 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,060 points
1,708 views