0

i have three difference topic that called: A - B - C. i produce a message in the "A" topic and I want "concurrent" consume that message in both B & C consumer. even though I set concurrency in application properties, my spring cloud application cannot Simultaneous consume this message in two topic. in other words this message cannot consume synchronize. Better to say that I have just an application in spring boot and dose not use micro service app. thanks

  • I feel like you are mixing consumers and topics. They are different concepts. One topic can have 0 to n consumers grouped or not into consumer groups. Also you need to explain what exactly you mean by concurrent in this context? Please provide more information about what you are trying to achieve. – Mike Mar 30 '21 at 06:07
  • Thanks for your answer. actually I want listen to a message in different consumer group, if I listen to this message in separate jar file, both consumer can get message simultaneous. but in my case I have just a jar file and when consumer "A" get the message, consumer "B" should wait until consumer "A" produce response – milad ghani Mar 30 '21 at 06:51
  • I want this message to be processed by two consumers simultaneously – milad ghani Mar 30 '21 at 06:59
  • In that case define a different consumer group for each of them. If consumer A belongs to consumerGroupA and B belongs to consumerGroupB then they will both process the messages. HOWEVER, you can't guarantee that it's dune concurrently, meaning that A might process offset 100 while B processes offset 105. Sure, later A will process offset 105 too, but when is not guaranteed. If you need to process them strictly at the same time, I would suggest using a single consumer that does 2 things to the message. – Mike Mar 30 '21 at 07:12
  • I separate them because both of them call http request and they get along time for response. anyway thank you for your explanation – milad ghani Mar 30 '21 at 07:39

0 Answers0