Hello Puneet, Why do you need multiple consumers from the same group consuming from the same partition? I am trying to think of a compiling reason for such a use case... It makes more sense to me to have a thread pool to process the records fetched from a single consumer. This is a great article to read: https://www.confluent.io/blog/kafka-consumer-multi-threaded-messaging/
P On Wed, Nov 23, 2022 at 8:00 AM Puneet Dubey <puneet.du...@epictenet.com> wrote: > Hi. > > In our app we have integrated kafka to publish and subscribe to the > events. Based on the documentation and distribution policy we designed our > application where we are facing some contradictory behavior. As per the > documentation at a given time there can be a maximum of one consumer per > partition. Our application is written in spring boot and we are using > org.springframework.kafka dependency to manage kafka and kafka clusters are > hosted in aws ec2 instances. > > While producing messages we are writing them in a specific partition let's > say 0 and we have a group of 3 consumers all reading same partition and > belong to the same group. Our expectation was that at a time only one > active consumer rest of the two will be idle. But what's happening is all > of them are receiving and processing the same message. Due to which desired > action is being performed thrice. Please suggest a solution. > > -- > > Thanks & Regards, > > Puneet Dubey > *Technical Consultant* > > [image: Epictenet] <https://www.epictenet.com/> > > *M.* +91 8269285876 > *P.* +0755 4030158 > *W.* www.epictenet.com > *A.* 3 & 11B, Essargee New Fort, BHEL, Bhopal (M.P.) 462022, India > *HO. *Level 10, 47 York Street, Sydney, NSW 2000, Australia >