Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

how to limit number of partitions assigned to consumer #283

Closed
nitin302 opened this issue Jan 3, 2019 · 2 comments
Closed

how to limit number of partitions assigned to consumer #283

nitin302 opened this issue Jan 3, 2019 · 2 comments

Comments

@nitin302
Copy link

nitin302 commented Jan 3, 2019

For Kafka, partitions provide a way for consumption to scale. Hence, it is necessary that consumers needs to scale horizontally as well.

  1. Is there any way to limit number of partitions per consumer, so that we can add more consumers so that all partitions are assigned to one of the consumers (total consumers * partitions per consumer = total partitions of the topic)? How can I do this?

  2. What should the configuration of the node in this case? What logic can be used for size a consumer for a given number of partitions?

@dim
Copy link
Member

dim commented Jan 3, 2019

@nitin302 I suggest that you look into IBM/sarama#1099 which has been merged and released, as sarama-cluster is now deprecated. You can configure a custom https://godoc.org/github.com/Shopify/sarama#BalanceStrategy which can plan the partition allocation to consumers based on a consumer's UserData. Hope that helps!

@dim dim closed this as completed Jan 3, 2019
@Shan4Kites
Copy link

@dim can you please add "deprecated" in the github description for this repo? it will help the new users.

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

No branches or pull requests

3 participants