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 in Apache Kafka by akhtar
• 25,390 points
1,119 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 by MD
• 57,560 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 by Pawan
• 380 points

Related Questions In Apache Kafka

+1 vote
2 answers

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

At present, There is no any alternative ...READ MORE

answered Jun 17 in Apache Kafka by Pawan
• 380 points
2,655 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 in Apache Kafka by MD
• 57,560 points
848 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 in Apache Kafka by MD
• 57,560 points
162 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,450 points
1,077 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 in Apache Kafka by MD
• 57,560 points
1,580 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
16,133 views
+1 vote
13 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 in Apache Kafka by Pawan
• 380 points
115,295 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
314 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 in Apache Kafka by MD
• 57,560 points
124 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 in Apache Kafka by MD
• 57,560 points
144 views