-
Notifications
You must be signed in to change notification settings - Fork 628
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
HighLevelProducer with KeyedPartitioner fails on first send #354
Comments
Yeah. I'm getting the same error no matter what I do. |
The random partitioner and default parttitioners work. |
Only for the first message, though. (or until the topic metadata is updated?) |
I've created a pull-request to fix it: As suspected, the metadata isn't updated when the producer is initialized, so the partitions array is empty, which causes the keyed partitioner to return |
Yup, same error. I have also found the documentation for working with keyed partitions very poor (probably because they don't work). I think this is something that could be improved upon as well. |
I just ended up rolling my own and manually setting partition number in payloads. |
I ran into this problem today, and I was able to get around it by calling I did all this with several promises, so it might be more difficult to do with just using callbacks. Basically, I didn't resolve the "producer" promise until after updating the metadata for the topic on the client. |
I've attemped to create a minimal example to reproduce this issue in this gist. I say attempted, because there's no error thrown with v4.0.1. I wasn't able to install v0.3.2, which seems to be what was available back then (and I'm not super keen on degrading my Arch system back to dinosaur). Is anyone able to use the example to confirm that this used to be an issue and isn't anymore? |
Hey, I opened a PR to fix this issue: #1360 |
When using
KeyedParitioner
with theHighLevelProducer
the first send fails withConsecutive sends work perfectly.
The text was updated successfully, but these errors were encountered: