spring-cloud-function-aws-example
spring-cloud-function-aws-example copied to clipboard
Unable to use dependency injection
The code as is works fine but as soon as I try to use dependency injection aws dies with error "No function defined". Just adding @ComponentScan(basePackages = { "com.test.pack1" }) throws the error
Any idea why that is? Is possible to do dependency injection in a lambda?
It must be possible. The example is showcasing the dependency injection (injecting a service into the function). I think you are missing the original packages from the component scan (those that contain the Function).