Replies: 2 comments 5 replies
-
Hi @ctron , In our project we faced the same challenge multiple times. You can find here one of the many examples we used as workaround https://github.com/5733d9e2be6485d52ffa08870cabdee0/sandbox/blob/main/shard-operator-parent/shard-operator-core/src/main/java/com/redhat/service/smartevents/shard/operator/core/networking/NetworkingServiceProducer.java . In short, we add a |
Beta Was this translation helpful? Give feedback.
-
There's no way to dynamically include/exclude beans at runtime. Quarkus does resolve all injection points (dependencies) at build time, i.e. the set of available beans cannot be modified when the app is built. This allows for various optimizations that follow the core design ideas of Quarkus. However, you can enable/disable beans during the build, i.e. for a specific build profile and when a build time property has/has not a specific value.
Exactly, |
Beta Was this translation helpful? Give feedback.
-
I want to enable beans during runtime, based one some property:
And:
I found
@LookupUnlessProperty
. However, to my understanding, these only work with "lookups", so I have to useInstance<Foo>
. I would be ok with this, but this doesn't seem to work with the@Startup
type bean.Beta Was this translation helpful? Give feedback.
All reactions