Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Kafka 0.10 - kafka console consumer not reading the data in order that it was published

Highlighted

Kafka 0.10 - kafka console consumer not reading the data in order that it was published

Expert Contributor

Hi All -

version - kafka 0.10

I'm publishing data into Kafka topic using command line, and reading the data using kafka console consumer

Publish command ->

$KAFKA_HOME/bin/kafka-verifiable-producer.sh --topic mmtopic1 --max-messages 100 --broker-list localhost:9092,localhost:9093,localhost:9094,localhost:9095 --producer.config $KAFKA_HOME/config/producer.properties

Console Consumer ->

$KAFKA10_HOME/bin/kafka-console-consumer.sh --zookeeper localhost:2161 --topic mmtopic1 --from-beginning

What i see is that the Kafka consumer is not reading the data in sequence i.e. the data on console is seen, but not in order it was published.

Is that expected ?

what do i need to do to ensure the Kafka consumer reads the data in sequence ?

1 REPLY 1

Re: Kafka 0.10 - kafka console consumer not reading the data in order that it was published

Guru

Hi @Karan Alang ,

does your KafkaTopic has several partitions (which are then spread across the brokers) ?

If you then ingest data that do not belong to the same partition, you'll see your reported behaviour since the order is ensured within a partition

HTH, Gerd

Don't have an account?
Coming from Hortonworks? Activate your account here