Implementing Lazy initialized Bean @Lazy #10511
Replies: 5 comments
-
Default for singletons is lazy initialization - https://docs.micronaut.io/latest/guide/#builtInScopes |
Beta Was this translation helpful? Give feedback.
-
If this is true @singleton = @lazy (Spring Boot) it means @context equivalent to @bean (Spring Boot) eager initialization. is that true? |
Beta Was this translation helpful? Give feedback.
-
Ok. I found some interesting info in the doc. we can change the @singleton behaviour
}` By setting this we use @singleton in Micronaut with exactly the same as @bean in spring boot |
Beta Was this translation helpful? Give feedback.
-
I'm not as familiar with Spring Boot, but I do believe |
Beta Was this translation helpful? Give feedback.
-
Unfortunately. I could not have @bean (Spring boot) behaviour in Micronaut. My app is a middle size app I wrote it using Spring Boot. It's great and working perfectly but a few months ago I will keep updating this post. I'm still looking and reading. |
Beta Was this translation helpful? Give feedback.
-
Issue description
I was looking for equivalent of Spring Boot @Lazy
I couldn't find anything about lazy initialized Bean.
Here is a quote from Spring boot doc
Is there an equivalent in Micronaut for such a behaviour?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions