-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
KeyedProducer doesn't actually send the key with the message #201
Comments
Are you setting the key in the message as well? The Message struct has the key https://github.com/mumrah/kafka-python/blob/master/kafka/common.py#L47 which gets serialized later. This is a bit confusing, maybe KeyedProducer should just use the key on the Message |
So the API I was using is: This expects strings for key and msg. I tried building a Message object and passing that as the |
Yup, you're right. That's a bug. |
I was also expecting the key in the message. Regarding #259 I think it's incorrect to expose a |
This was kind of unexpected. It seems it's only using the key locally to decide the partition, but not actually serializing it with the message.
Is this intentional? If so it's probably worth documenting so people don't go crazy trying to track down bugs with the missing keys. It'd be nice to have an option at least to serialize the key when using a KeyedProducer.
The text was updated successfully, but these errors were encountered: