0

I have this code to create consumer balanced in pykafka :

consumer = topic.get_balanced_consumer(consumer_group='Testing',auto_commit_enable=True,zookeeper_connect='amsmgmt002:2181,nas5:2181,amsdblx006:2181')

How the state of consumer is managed across the processes ?

thanks

Nishu Tayal
  • 20,106
  • 8
  • 49
  • 101
quantCode
  • 495
  • 1
  • 5
  • 12

1 Answers1

0

From the pykafka readme:

You can have as many BalancedConsumer instances consuming a topic as that topic has partitions. If they are all connected to the same zookeeper instance, they will communicate with it to automatically balance the partitions between themselves. The partition assignment strategy used by the BalancedConsumer is the "range" strategy by default. The strategy is switchable via the membership_protocol keyword argument, and can be either an object exposed by pykafka.membershipprotocol or a custom instance of pykafka.membershipprotocol.GroupMembershipProtocol.

Emmett Butler
  • 5,969
  • 2
  • 29
  • 47