How to consume messages from a specific partition of a topic in kafka

Viewed 469

I want a kafka consumer to consume messages from a particular/specified partition of a topic

It works using kafka-console-consumer.sh with switch --partition partition_number

I am using kafka_complex_consumer_example.c code from librdkafka

Upon static code analysis, I feel it can serve my purpose but I am not able to find out the exact command line parameters to be passed to main(int argc & char **argv) function for the code to run and start consuming on a topic's particular partition.

Have a look at the code here - rdkafka_complex_consumer_example.c

Full github code of librdkafka here FYR

If this code doesn't serve the purpose, please specify some other code that can help

1 Answers
Related