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,130 points
1,631 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

Thank You

answered Feb 6, 2020 by MD
• 94,990 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 17, 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 3, 2020 in Apache Kafka by Tamás
• 140 points
3,839 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
• 94,990 points
1,473 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
• 94,990 points
321 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
• 94,990 points
47 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
• 94,990 points
2,609 views
+1 vote
10 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
18,451 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
136,201 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
373 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
• 94,990 points
165 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
• 94,990 points
234 views