-
Notifications
You must be signed in to change notification settings - Fork 228
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
receiveAutoAck commits the batch even in case of exception (or Error) while processing #261
Comments
Seems pretty serious |
Is there any fix you can think of? |
@rancherz the simplest solution would be replacing of It might be not expected for existing clients, so there may be a configuration parameter added to the |
I see the issue, but the behavior is consistent with the javadocs and reference manual:
So I am not sure there is anything to be done here. This is similar (not identical) to the For more control over commits, you can use the If you feel a change is necessary, I would concur that it would need to be optional; contributions are welcome. |
…in case of errors on processing. See reactor/reactor-kafka#261 for details.
@garyrussell to me as a user of this library's API this was such an unclear moment that I filed this issue. Apparently, Javadoc or the reference might be improved in this regard. I don't have spare time at the moment. I choose to stay with the single manual acknowledge receive function. What I suggest as a contribution is to add a new API function |
I would say that "can be used for at-least-once delivery of messages" is really misleading. This misunderstanding cost me hours of lost updates hunting. All @serejke solutions look reasonable. |
I plan to do a PR on this subject during October |
receiveAutoAck returns a
Flux<Flux<Record>>
for batches of received records. The internal flux gets terminated (even in case of exception) and commits the batch, because of doOnTerminate callback.I might be missing something, but I don't see a way to avoid committing the batch if a crash occurs (such as OutOfMemory).
I've prepared a test case
receiveAutoAck
is said to be suitable for at-least-once delivery of messages, but in fact the events might be committed before they are processed.The text was updated successfully, but these errors were encountered: