0

So I am trying to have a single function for multiple topic destinations and consumer groups. However I am stuck with the syntax. I am trying to achieve the below, but not sure if that's possible and if it is then what will be the syntax in the application.yml

function : handleEvent

topics: topicAEvent, topicBEvent, topicCEvent
consumer group : AEventConsumergroup, BEventConsumergroup, CEventConsumerGroup

application.yml

spring:
 cloud:
  function:
   definition: handleEvent;
  stream:
   kafka:
    bindings:
     handleEvent-in-0:
      group: AEventConsumergroup, BEventConsumergroup, CEventConsumerGroup
      destination: topicAEvent, topicBEvent, topicCEvent

Is there a way to have a single function that can provide Consumer Bean for multiple kafka topics and consumer groups?

ghostrider
  • 2,046
  • 3
  • 23
  • 46
  • You should make unique bindings for each group and topic – OneCricketeer Jun 20 '22 at 22:11
  • @OneCricketeer, thanks for the comment. But is there any benefit to that? – ghostrider Jun 21 '22 at 05:59
  • I'm not sure I understand the question, but `group` and `destination` can only take one value in the config, I believe. You can use one Kafka consumer group with multiple topics being consumed, though. Otherwise, if you want to loop through a list of entries, you'll need to programmatically build the stream binder – OneCricketeer Jun 21 '22 at 14:12

0 Answers0