Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does confluent-kafka-go producer PartitionAny is round robin produce message to kafka? #1201

Open
hueiyuan opened this issue May 31, 2024 · 1 comment
Labels

Comments

@hueiyuan
Copy link

Description

We found that the message on partition is not balanced. And we are not sure Partition: kafka.PartitionAny default is round robin strategy? Hope someone can assist to answer, thank you.

@milindl
Copy link
Contributor

milindl commented Jun 4, 2024

It is not round robin. It is instead sent at random (if the key is not specified). If the key is specified, then a hash of the key is taken, there are separate hash functions available available.

If the key is null or empty, it is determined using rand(3) from libc. With enough messages, it should end up being more or less uniformly distributed, hopefully.

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

No branches or pull requests

2 participants