> Fine grained tracking of status of individual events is quite painful in
> contrast to simply blocking on every batch. Old style Batched-sync mode
> has great advantages in terms of simplicity and performance.
I may be missing something, but I'm not so convinced that it is that
painful/very different from the old-style.
In the old approach, you would compose a batch (in a list of messages)
and do a synchronous send:
try {
producer.send(recordsToSend)
}
catch (...) {
// handle (e.g., retry sending recordsToSend)
}
In the new approach, you would do (something like) this:
for (record: recordsToSend) {
futureList.add(producer.send(record));
}
producer.flush();
for (result: futureList) {
try { result.get(); }
catch (...) { // handle (e.g., retry sending recordsToSend) }
}