How can I create multiple consumers in apache kafka

0 votes

Hi,

I have multiple producer in kafka. How can I create multiple consumers?

Thank You

Feb 6, 2020 in Apache Kafka by akhtar
• 38,260 points
3,574 views

2 answers to this question.

0 votes

Hi@akhtar,

If you already created multiple producers then use the bellow command according to your port no.

$ ./bin/kafka-console-consumer.sh --zookeeper localhost:2181 -topic topic-name --from-beginning

Hope this will work

Join our Kafka course online today to become certified expert.

Thank You

answered Feb 6, 2020 by MD
• 95,460 points
0 votes
First of all, Consumer is not thread safe. So before going to write multiple consumers please make this class as thread safe. After that, you can execute as multiple worker in multithreading environment using Executor Framework.
answered Jun 18, 2020 by PAWAN
• 380 points

Related Questions In Apache Kafka

+1 vote
3 answers

What is the need of zookeeper in kafka? Can I use kafka without zookeeper?

I just would like to complete the ...READ MORE

answered Dec 4, 2020 in Apache Kafka by Tamás
• 140 points
8,744 views
0 votes
1 answer

How can I connect aws lambda and kafka ?

Hi@Rishabh, I think to implement this task you ...READ MORE

answered May 4, 2020 in Apache Kafka by MD
• 95,460 points
3,684 views
0 votes
1 answer

how can we delete the topic in kafka in kafkatool application ?

Hi@sreeveena, I am not sure but there may be ...READ MORE

answered May 13, 2020 in Apache Kafka by MD
• 95,460 points
1,685 views
0 votes
1 answer

How to create a Kafka topic in a broker?

Hi@akhtar, To create a Kafka topic, you need ...READ MORE

answered Dec 7, 2020 in Apache Kafka by MD
• 95,460 points
1,610 views
0 votes
1 answer

How to know leader information in kafka?

Hi@akhtar, To know leader information you can use ...READ MORE

answered Feb 10, 2020 in Apache Kafka by MD
• 95,460 points
16,503 views
+2 votes
9 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
38,556 views
+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
229,413 views
+1 vote
0 answers

Want to delete consumed topic programatically

directly delete kafka log folder and zeekeeper ...READ MORE

Jun 4, 2019 in Apache Kafka by sarvesh
1,643 views
0 votes
1 answer

How can I create a topic in apache kafka?

Hi@akhtar, To create kafka topic you can use ...READ MORE

answered Feb 6, 2020 in Apache Kafka by MD
• 95,460 points
1,149 views
0 votes
1 answer

How can i connect to an api which gives me weather data to Apache kafka?

Hi, To connect an API in kafka, you ...READ MORE

answered Apr 13, 2020 in Apache Kafka by MD
• 95,460 points
1,339 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