We are using Spring Kafka 2.2.2 Release to retrieve records from Kafka using @KafkaListener and with the ConcurrentKafkaListenerContainerFactory. We have configured the max-poll-records to 5, however it always gives only 1 record in the list to the consumer instead of 5 records.
Whilst with the same configuration, it works in Spring Kafka 2.1.4.Release.
Here is our application.yml configuration:
spring:
kafka:
bootstrap-servers: localhost:9092
consumer:
enable-auto-commit: false
max-poll-records: 5
bootstrap-servers: localhost:9092
group-id: group_id
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: com.gap.cascade.li.data.xx.xx.CustomDeserialiser
Here is our ConcurrentKafkaListenerContainerFactory:
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> kafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory<>();
factory.setConsumerFactory(consumerFactory());
factory.setBatchListener(true);
return factory;
}
Are we missing any configuration which needs to be done for Spring Kafka 2.2.2 Release?