newcoder
newcoder

Reputation: 492

kafka multi node set up active-Active

I am new to kafka and have some basic doubts. I was trying to do a multinode kafka set up (Active-Active). here is the scenario :-

  1. running single zookeeper (port: 2181)
  2. started three kafka brokers (9092,9093,9094)
  3. create a single topic test (partition: 1, replication 3)
  4. started producer using broker list (9092,9093)
  5. started consumer on 9092,9093,9094, but all of them are using same topic.

Now my doubts are, when I am sending a message from producer it is consumed by all three consumer,

q1. does that mean it is duplicating the message ?

q2. as producer is running on 9092,9093 then why consumer on port 9094 is consuming the message ? is it because it is using same topic name ?

q3. how I can make sure when i am sending a message from producer it should be consumed by a single consumer ? (I tried grouping but if any consumer is in different group it is receiving the message.)

q4. if I want to distribute the messages between consumers, how I can achieve this ?

q5. any other way to set up a multi node kafka (Active-Active) with single producer and multiple consumers ?

any help is appreciated.

Upvotes: 0

Views: 1267

Answers (1)

dawsaw
dawsaw

Reputation: 2313

I've answered in comments, but this is really a question coming down to a lack of understanding about consumer groups in Kafka. This is too long to discuss in this format, so I'll direct you here https://kafka.apache.org/documentation/#theconsumer

Upvotes: 0

Related Questions