Based on kafka doc, this parameter should maintain the message ordering: max.in.flight.requests.per.connection The maximum number of unacknowledged requests the client will send on a single connection before blocking. Note that if this setting is set to be greater than 1 and there are failed sends, there is a risk of message re-ordering due to retries (i.e., if retries are enabled).
On Tue, Mar 28, 2017 at 4:17 PM, Henry Cai <h...@pinterest.com> wrote: > If I use kafka's AsyncProducer, would I still be able to achieve message > ordering within the same partition? When the first message failed to send > to broker, will the second message (within the same kafka partition) being > sent out ahead of first message? > > Based on this email thread, it seems AsyncProducer can maintain ordering > even on sent-failure situation: > > https://groups.google.com/forum/#!topic/kafka-clients/lWlRRc5JNmg > >