Programmatically create\define Spring Cloud Stream bindings and Function

246 Views Asked by At

I am looking for a way programmatically to create Function and binding of function to existing Channel (Channel will be added)

Ideally would be in event "BindingCreatedEvent" to create additional Binding.

To extend, the bellow configuration works as expected, I need programmatically create same entities

spring:
  cloud:
    function:
      definition: functionForProcessor1function
    stream:
      function:
        bindings:
          functionForProcessor1-in-0: functionForProcessor1_subscribe

Why it needed? For each channel that Bound Binder "Kafka1", will need to consumer additional channel from other "Binder" - "Kafka2"

The use is Spring Boot 3.x+

I have tried to create new configuration in EnvironmentPostProcessor, and it worked as expected Need still to check option to create Function and Bindings dynamically in runtime

0

There are 0 best solutions below