title: Apache-Kafka, batch.size vs buffer.memory
body: <p>I'm trying to figure out the difference between the settings batch.size and buffer.memory in Kafka Producer.</p>
  
  <p>As I understand batch.size: It's the max size of the batch that can be sent.</p>
  
  <p>The documentation describes buffer.memory as: the bytes of memory the Producer can use to buffer records waiting to be sent.</p>
  
  <p>I don't understand the difference between these two. Can someone explain?</p>
  
  <p>Thanks</p>