pykafka
pykafka copied to clipboard
Create two consumers bundled under the same group to get the same data!
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())
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.
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.