bean lookup disabled observer still working #38349
-
I got a bit surprised by a behaviour in quarkus, that I think is by design but I would like to confirm as may also be a bug. I have a service bean that is I was under the impression I could have multiple services with observers, and only the ones with the lookup enabled would actually handle the events but looks like its not. In any case I have a small reproducer here; https://github.com/manofthepeace/lookup-observer |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@mkouba , sorry for the ping. |
Beta Was this translation helpful? Give feedback.
It really works as designed. As explained in the docs the
@LookupIfProperty
can only be used to narrow down the set of beans that can be obtained by programmatic lookup via@Inject Instance<>
. It's very similar to how CDI@Alternative
and observers work. You can't inject the bean that is "hidden" by an@Alternative
bean but the observers are still notified.