Search code examples
javaspringpropertiescloudspring-cloud-stream

Can I set the property spring.cloud.function.definition programmatically?


I use Spring Cloud streams for Kafka and set properties like this:

spring.cloud:
    stream:
        function.definition: method1;method2;...

Can I set the property "spring.cloud.stream.function.definition" (or "spring.cloud.function.definition", which is the same) in Java code?


Solution

  • I've found the solution:

    StreamFunctionProperties streamFunctionProperties;
    ....
    streamFunctionProperties.setDefinition("method1;method2");