James, There are separate queues for each partition, so there are no guarantees on the order of the sends (or callbacks) between partitions. (Actually, IIRC, the code intentionally randomizes the partition order a bit, possibly to avoid starvation)
Gwen On Mon, Jul 13, 2015 at 5:41 PM, James Cheng <jch...@tivo.com> wrote: > Hi, > > I'm trying to understand the new producer, and the order in which the > Callbacks will be called. > > From my understanding, records are batched up per partition. So all records > destined for a specific partition will be sent in order, and that means that > their callbacks will be called in order. > > What about message batches that cover multiple partitions? E.g. If I send > three messages to three partitions A, B, and C, in the following order: > > A1 A2 A3 B1 B2 B3 C1 C2 D3 > > Then is it possible that messages B1 B2 B3 will be sent prior to A1 A2 A3? > Which means the callbacks for B1 B2 B3 will also be called prior to the ones > from A1 A2 A3? > > Thanks, > -James >