pykafka icon indicating copy to clipboard operation
pykafka copied to clipboard

Create two consumers bundled under the same group to get the same data!

Open stone0018 opened this issue 5 years ago • 2 comments

I created two consumers through the code. When I tried to use the publisher to publish the data, I saw that the data obtained by the two consumers is the same data. Version used: pykafka 2.8.0 python 3.6

client = KafkaClient(hosts=hosts)
topic = client.topics['test']
consumer = topic.get_simple_consumer(consumer_group = 'test1',   
                                                                                     consumer_id='test_client2',  #334 Different ID
                                                                                    auto_commit_enable=True)
for message in consumer:
    print(message.value.decode())

stone0018 avatar Jul 24 '19 03:07 stone0018

Thanks @stone0311. To make debugging possible, please indicate what behavior you expect from this use case as well as how the observed behavior differs from it.

emmettbutler avatar Aug 26 '19 15:08 emmettbutler

Thanks @stone0311. To make debugging possible, please indicate what behavior you expect from this use case as well as how the observed behavior differs from it.

I expect different consumers to get different data under the same kafka topic, but I set different consumer_id and same consumer_group by creating different consumers, and the last data obtained is the same data.

stone0018 avatar Oct 09 '19 08:10 stone0018