How is ordering guaranteed during failures in Kafka Async Producer? -


if using kafka async producer, assume there x number of messages in buffer. when processed on client, , if broker or specific partition down sometime, kafka client retry , if message failed, mark specific message failed , move on next message (this lead out of order messages) ? or, fail remaining messages in batch in order preserve order?

i next maintain ordering, ideally want kafka fail batch place failed, can retry failure point, how achieve that?

like says in kafka documentation retries

setting value greater 0 cause client resend record send fails potentially transient error. note retry no different if client resent record upon receiving error. allowing retries potentially change ordering of records because if 2 records sent single partition, , first fails , retried second succeeds, second record may appear first.

so, answering title question, no kafka doesn't have order guarantees under async sends.


i updating answers base on peter davis question.

i think if want send in batch mode, way secure set max.in.flight.requests.per.connection=1 documentation says:

note if setting set greater 1 , there failed sends, there risk of message re-ordering due retries (i.e., if retries enabled).


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -