title: Does a Kafka Consumer default batch size?
body: <p>Does Kafka provide a default batch size for reading messages from a topic? I have the following code that is reading messages from a topic. </p>
  
  <pre><code>  while (true) {
          final ConsumerRecords&lt;String, User&gt; consumerRecords =
                  consumer.poll(500));
          if (consumerRecords.count() == 0) {
              noRecordsCount++;
              if (noRecordsCount &gt; giveUp) break;
              else continue;
          }
          consumerRecords.forEach(record -&gt; {
              User user = record.value();
              userArray.add(user);
          });
  
          insertInBatch(user)
          consumer.commitAsync();
      }
      consumer.close();
  </code></pre>
  
  <p>In the insertInBatch method, I persist data to a database. This method is getting called every 500 records, even though I haven't specified any batch size in creating the Consumer. 
  I don't think there's anything special about the way I'm creating it. Using Avro for the messages, but I don't think that's significant(?)</p>
  
  <pre><code>Properties props = new Properties();
      props.put("bootstrap.servers", "localhost:9092");
      props.put("group.id", "test");
      props.put("auto.commit.enable", "false");
      props.put("auto.offset.reset", "earliest");
  
      props.put("key.serializer",StringSerializer.class.getName());
      props.put("value.serializer",KafkaAvroDeserializer.class.getName());
      props.put("schema.registry","http://localhost:8081");
  </code></pre>