Spring Cloud Stream multiple function definitions

北城以北 提交于 2020-01-25 08:03:26

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/58373430/spring-cloud-stream-multiple-function-definitions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!