-
Notifications
You must be signed in to change notification settings - Fork 387
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
Ensure write and order guarantees with Producer.committableSink #1265
Conversation
Initial benchmarks indicate enforcing |
@PrathikPuthran The intention is that using |
@PrathikPuthran Hello again. Let me know if you have time to check if this setting resolves the issue for you. If it does then we can make this the default for 2.1.0. |
@seglo Sorry for the delay. Would this work if custom partitioning is used in the kafka producer? |
@PrathikPuthran Yes, I don't see why not. All it's doing is using sequence numbers (per destination partition for the length of the producer session) to ensure message ordering and for the broker to determine if any messages have been missed or duplicated. Missed messages will result in a fatal exception, dupes will be de-duped silently on the broker side. Your broker must be at least version |
Yes but if send to one broker partition fails (if one broker is unhealthy) but the send for some other broker partition succeeds with messages of higher offsets you would still be committing offsets out of order I think? |
I did some digging and I can't find an official statement that callbacks can return out of order with |
This may be better served as a note in the docs on |
If someone can confirm if |
References #1242
Enforce
enable.idempotence
when using theProducer.committableSink
. This will ensure that produced messages are recorded once and in the order they were sent to the broker. Some caveats with this solution:max.in.flight.connections
must be<= 5
(enforced by settingenable.idempotence=true
)acks
must be set toall
(enforced by settingenable.idempotence=true
)