-
Notifications
You must be signed in to change notification settings - Fork 141
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
More precise batch publish errors #1321
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! By making sure the loop uses the ref for every case we can retain the trick of counting the number of updates to the array before calling done.succeed. Much better than my rough proposal. 🚀
The benchmark looks very good! (this pr is the last point on the graph)
What is missing now is a test and documentation. Let us know if you want help with either of these.
Sounds great, 👍, thanks for the suggestions, Erik! |
I was mostly thinking of the scaladoc of the For all
And for
About that, I now see that
We don't have any low level tests for the producer yet (I mean, with a mock kafka client). Anything in this area would be super helpful! |
Oh, got it, sounds good, will do so, 👍
Yeah, this is a great call, thanks, Erik!
Nice, will update PR soon. |
I think this looks amazing. The test are pretty complicated but they look like what is needed. @svroonland, did you already take a look as well? |
I think they can be revisited later and simplified/updated, this is just a start so to say
Sure, would love that, thanks, Erik! |
Done! |
In this PR the producer no longer attempts to send subsequent records after the |
This increases the precision of the result of producer method
produceChunkAsyncWithFailures
for cases where something went wrong. There are two changes compared to before:produceChunkAsyncWithFailures
now accurately corresponds to each record in the input chunk. Previously, if sending fails directly (*) on any of the given records, the error would be used for all records in the batch, ignoring the send-outcome of the other records. An advantage of this change is that if sending some records failed, but some other records were actually sent, you can now correctly see all of that in the method's response.PublishOmittedException
for each record that is not sent. When implementing retries, this change makes it easier to publish records in the original order.In addition, we introduce unit-level tests for the producer.
(*) By 'sending' we mean offering a record to the underlying java Kafka producer. Sending can fail directly (when we call the method), or later on (from a callback).