If I use listener.concurrency property, would this use KafkaMessageListenerContainer or ConcurrentMessageListenerContainer? Note I have not defined any beans explicitly and I leave the required bean creation to spring boot.
I wanted to know if my understanding is correct. I would want parallelism in consuming the message from topic which has got multiple partitions say 3. So is it fine if I configure it in application.yml
file as follows. I have tried below configuration and see 3 consumers were created.
spring:
kafka:
consumer:
group-id: group-id
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
producer:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.apache.kafka.common.serialization.StringSerializer
listener:
concurrency: 3
So my question is, do I have to create a bean to configure ConcurrentMessageListenerContainer
or the above listener configuration would internally would use ConcurrentMessageListenerContainer
instead of KafkaMessageListenerContainer
when it sees listener.concurrency=3
?