title: Spring @KafkaListener execute and poll records after certain interval
body: <p>We wanted to consume the records after a certain interval (e.g. every 5 minutes).
  Consumer properties are standard:</p>
  
  <pre><code>@Bean
  public KafkaListenerContainerFactory&lt;ConcurrentMessageListenerContainer&lt;Integer, String&gt;&gt; kafkaListenerContainerFactory() {
      ConcurrentKafkaListenerContainerFactory&lt;Integer, String&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
      factory.setConsumerFactory(consumerFactory());
      factory.setConcurrency(1);
      factory.setBatchListener(true);
      factory.getContainerProperties().setPollTimeout(300000);
      factory.getContainerProperties().setAckMode(AbstractMessageListenerContainer.AckMode.BATCH);
      return factory;
  }
  </code></pre>
  
  <p>Even though when i change the property <code>setPollTimeout</code> it doesnot poll after defined interval (5 minutes), it continuously polls after 30 seconds, here are my logs:</p>
  
  <pre><code>2018-01-23 18:07:26.875 INFO 60905 --- [        2-0-C-1] c.t.k.s.consumer.FavoriteEventConsumer   : Consumed: san@1516710960000-&gt;1516711080000 2
  
  2018-01-23 18:07:56.901 INFO 60905 --- [        2-0-C-1] c.t.k.s.consumer.FavoriteEventConsumer   : Consumed: san@1516710960000-&gt;1516711080000 4
  </code></pre>
  
  <p>We were trying to build a kafka stream application with windowed aggregations and planning to consume the window x after y interval.</p>
  
  <p>I can see that in the class: <code>KafkaMessageListenerContainer</code>, <code>setConsumerTaskExecutor</code> is set:</p>
  
  <pre><code>if (containerProperties.getConsumerTaskExecutor() == null) {
          SimpleAsyncTaskExecutor consumerExecutor = new SimpleAsyncTaskExecutor(
                  (getBeanName() == null ? "" : getBeanName()) + "-C-");
          containerProperties.setConsumerTaskExecutor(consumerExecutor);
      }
  </code></pre>
  
  <p>But how do we configure when this (frequency) thread pool polls records. Any help appreciated.</p>