简体   繁体   中英

Spring Boot Microservice Connecting to Kafka

I have a Kafka consumer defined in my microservice. I have deployed 5 instances of my application. I have set concurrency parameter in ConcurrentKafkaListenerContainerFactory to 2. Does this mean there are 2 consumer instances for each app instance or 2 consumer instances for the entire topic that I am connecting to?

It means you have 2 consumers in each app instance; you need at least 10 partitions on the topic so each consumer will be assigned a partition. The app instances don't know about each other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM