Open aaron-benson-on-code opened 4 years ago
I did some more research on this and found a few things.
I downgraded to spring-cloud-dependencies version Greenwich.RC1 which also required a downgrade to spring-boot-starter-parent version 2.1.x. If I did that AND added spring-boot-starter-webflux to the classpath even though I am not creating a flux function I get this to work. However, without spring-boot-starter-webflux even with spring-cloud-starter-function-web the application will start and immediatly exit status 0 with no logs besides the following:
2020-03-14 15:02:07.075 INFO 2341 --- [ main] io.spring.sample.DemoApplication : Starting DemoApplication on Aarons-MacBook-Pro.local with PID 2341 (/Users/aaron/workspace/spring/test-spring-function/target/classes started by aaron in /Users/aaron/workspace/spring/test-spring-function)
2020-03-14 15:02:07.087 INFO 2341 --- [ main] io.spring.sample.DemoApplication : No active profile set, falling back to default profiles: default
2020-03-14 15:02:07.508 INFO 2341 --- [ main] io.spring.sample.DemoApplication : Started DemoApplication in 1.122 seconds (JVM running for 2.199)
Process finished with exit code 0
If I upgrade to any version of Hoxton and Spring 2.2.x I get the original error I opened the defect with.
If I get some time I will do some more digging to find what is actually happening
@aaron-benson-on-code so unfortunately FunctionExporter is kind of coupled to webflux
. And just as an FYI it has nothing to do with the type of function you are declaring (reactive or imperative). To address this properly will require a bit more surgery. . .
Meanwhile, changing spring-cloud-starter-function-web
to spring-cloud-starter-function-webflux
does the trick and you don't need to downgrade anything.
@olegz Thanks that worked
Describe the bug Following documentation on functional bean registration of spring cloud functions. Traditional bean registration works fine but when using FunctionalSpringApplication an error occurs with unable to create bean with name FunctionExporterAutoConfiguration. spring-cloud-starter-function-web and spring-boot-starter are both on classpath.
full stack trace:
main class
Full Source Code Url