Can two java instances belong to the same consumer group when kafka consumers are multithreaded?

configure concurrency
spring.kafka.listener.concurrency=50

when a springboot program uses
spring.kafka.consumer.group-id=orderGroup
@ KafkaListener (topics = "orders").

if the program deploys two instances
, are there 100 consumer threads that belong to the consumer group orderGroup?

Dec.19,2021

should be. After you start the program, you can take a look at it with the command of kafka:

 

look at how many consumption instances have been created for you, and groupID is the same. That belongs to the same group.

can serve as a redundant and loaded job, but it is not reasonable to allocate 100 instances in two processes.

you can have 4 processes, each process has N consumption instances, and the specific number depends on the number of partitions of your Topic .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e48273-44c87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e48273-44c87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?