Access CDI beans from BeanStep route handler for Quarkus extension #46564
-
Hi, I'm currently working on a PR for the quarkus google cloud extension (ref: quarkiverse/quarkus-google-cloud-services#776 ) together with @loicmathieu . What I want to achieve is register a specific endpoint (conditionally, if the config is enabled) to handle push messages. Given the docs at https://quarkus.io/guides/writing-extensions#extension-defined-endpoints I see I can register a custom handler which should be sufficient for what I want to achieve. However, from the handler (the What is the correct way to access CDI beans from that handler (which is not a CDI bean itself)? Just use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
CDI.current()
orArc.container()
is probably the best option if the caller is not a CDI bean.