spring-cloud-function-aws-example icon indicating copy to clipboard operation
spring-cloud-function-aws-example copied to clipboard

Unable to use dependency injection

Open sefo opened this issue 7 years ago • 1 comments

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?

sefo avatar May 22 '18 06:05 sefo

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).

laxika avatar Jun 10 '18 17:06 laxika