Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

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

Open
stone0018 opened this issue Jul 24, 2019 · 2 comments
Open

Comments

@stone0018
Copy link

stone0018 commented Jul 24, 2019

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())
@emmettbutler
Copy link
Contributor

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.

@stone0018
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants