Open jaiananth opened 3 years ago
Well, first of all your provided example is anything but trivial given everything that is in application.yaml file. but i looked anyway. What got my attention is this
function:
definition: initializer|validatorAndEnrichment|processor;prepareSplunkRequest|postToSplunk
I don't know where all these functions are coming from. They are not part of your application, so perhaps some dependency, but anyway, the failure happens on processor
which in your case happens to be ExpressionEvaluatingHeaderValueMessageProcessor
and is NOT a Function, Supplier or Consumer. It is not even compliant with @FunctionalInterface
as it has multiple public methods, so what were your expectations?
Any updates on this?
Issue: Spring cloud function is not exluding custom java beans and it is expecting Supplier, Function or Consumer type. related to https://github.com/spring-cloud/spring-cloud-stream/issues/2228
To Reproduce
Please find the attached sample project to recreate.
functiontype.zip
@Bean public Function<String, String> uppercase() { return v -> v.toUpperCase(); }
Caused by: java.lang.IllegalArgumentException: Type must be one of Supplier, Function or Consumer at org.springframework.util.Assert.isTrue(Assert.java:121) ~[spring-core-5.3.10.jar:5.3.10] at org.springframework.cloud.function.context.catalog.FunctionTypeUtils.discoverFunctionTypeFromClass(FunctionTypeUtils.java:149) ~[spring-cloud-function-context-3.1.3.jar:3.1.3] at org.springframework.cloud.function.context.catalog.FunctionTypeUtils.discoverFunctionType(FunctionTypeUtils.java:267) ~[spring-cloud-function-context-3.1.3.jar:3.1.3] at org.springframework.cloud.stream.function.FunctionConfiguration$FunctionBindingRegistrar.filterEligibleFunctionDefinitions(FunctionConfiguration.java:907) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.cloud.stream.function.FunctionConfiguration$FunctionBindingRegistrar.afterPropertiesSet(FunctionConfiguration.java:796) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.10.jar:5.3.10] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.10.jar:5.3.10] ... 21 common frames omitted
Version of the framework spring-cloud-function-core 3.1.3 spring-cloud-function-context 3.1.3