Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Stream multiple function definitions

Is it possible to have reactive SCS application using functional (spring.cloud.function) style with multiple, separate functions / bindings? All examples I have found always register only one functional bean with default bindings input, output. I would like to register multiple, each with its own bindings.

Traditionally this could be done using spring-cloud-stream-reactive but it is now deprecated in favor of functional support.

like image 384
B.Gen.Jack.O.Neill Avatar asked Dec 18 '22 15:12

B.Gen.Jack.O.Neill


1 Answers

Yes, it is possible in the latest snapshot and we'll be making RC1 shortly (were busy with the conference). Here is the link to the relevant docs. Basically you define as many function beans as you want and you declare how many functions you want to bind via spring.cloud.function.definition property delimiting function definitions with ;. For example, --spring.cloud.function.definition=foo;bar|baz where you are binding two functions; one is foo and second is bar|baz (composition of two functions). The binding names will be based on the naming convention. For example, foo-in-0 and foo-out-0.

like image 189
Oleg Zhurakousky Avatar answered Mar 15 '23 22:03

Oleg Zhurakousky