You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Yang <te...@gmail.com> on 2015/02/06 23:11:51 UTC

one message consumed by both consumers in the same group?

my understanding is that for 2 consumers within the same group, a message
goes to only one of the consumers, not both.

but I did a simple test: get the kafka distro, copy the code dir to
/tmp/kafka/

then run console consumer from both dirs at the same time

bin/kafka-console-consumer.sh --.....

all the parameters are the same

then I use console producer to dump some messages into the queue. the
message does show up on both ends.


where am I doing wrong?

thanks
Yang

Re: one message consumed by both consumers in the same group?

Posted by Manikumar Reddy <ku...@nmsworks.co.in>.
Hi,

bin/kafka-console-consumer.sh --.....
>
> all the parameters are the same
>

 You need to set same group.id to create a consumer group. By default
console consumer creates a random group.id.
 You can set group.id by using " --consumer.config /tmp/comsumer.props"
flag.

  $$>echo "group.id=1" > /tmp/consumer.props