Skip to content

how do guarantees messages were written to kafka? #342

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

Closed
boer0924 opened this issue Aug 27, 2019 · 2 comments
Closed

how do guarantees messages were written to kafka? #342

boer0924 opened this issue Aug 27, 2019 · 2 comments
Assignees

Comments

@boer0924
Copy link

boer0924 commented Aug 27, 2019

Reference

https://godoc.org/github.com/segmentio/kafka-go#Writer.WriteMessages
https://github.com/segmentio/kafka-go#explicit-commits

Note that in this case there are no guarantees made on whether messages were written to kafka.

Q

how do guarantees messages were written to kafka?
&
explicit commits r.CommitMessages(ctx, m) can guarantees offsets commited?

@achille-roussel
Copy link
Contributor

achille-roussel commented Sep 4, 2019

Hello @boer0924.

CommitMessages is a reader method, it is not involved in the write path.

The WriteMessages documentation states

Unless the writer was configured to write messages asynchronously, the method blocks until all messages have been written, or until the maximum number of attempts was reached.
Another way to phrase it is, unless you are configuring the writer to work asynchronously, messages are guaranteed to be written to Kafka if the method call returns no errors.

Let me know if you need anything else to be clarified.

@achille-roussel
Copy link
Contributor

This issue has been stale for a while. I'll go ahead and close it but feel free to reopen if this is still a problem.

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

No branches or pull requests

2 participants