spring-cloud-function
spring-cloud-function copied to clipboard
FunctionCatalog and BeanFactory effectively end up with the same component names, yet different instances
So, we register functions as @Bean, then we take them from BF, wrap them and add them to FunctionCatalog and perform further lookups on FunctionCatalog.
However a common mistake is developers autowire functions expecting them to be "instrumented functions" when inside BF they are just beans.
We can probably use BPP to instrument functions at startup time in BF. That would ensure that a single function can be equally looked up via BF or FC, while composed functions would still have to be looked up in FC