Considering that the producer.send() method returns a Future, does doing a future.get() right after it block the batching of records as well ?
Considering that the producer.send() method returns a Future, does doing a future.get() right after it block the batching of records as well ?
It blocks to flush the buffer of records and wait for any configured ack of the producer.
KafkaProducer is thread safe, so calling send in a non blocked thread should work, but may result in out-of-order events.
Otherwise, yes, you can call send as many times as needed to batch up data, and not get the first Future.