Replies: 2 comments 7 replies
-
|
/cc @radcortez (config) |
Beta Was this translation helpful? Give feedback.
-
If there is a valid injection point required by the current configuration, the injection point must be satisfied, meaning that a valid connection must exist.
How are you doing this? Redis connection configuration is runtime, so if you have a valid connection configuration, a bean is available for it, unless there is a bug. Health checks should only be available to valid Redis connections.
Take a look at https://quarkus.io/guides/datasource#datasource-active. Redis should work similarly. You should be able to use Also |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We use Quarkus to build multiple applications for many clients.
Each client has a different set of enabled or disabled features, which we control via feature flags.
Sometimes, however, we hit build-time restrictions.
As I understand, the Quarkus ecosystem generally suggests having separate builds with specific features enabled or disabled.
But in our case, we support a large matrix of feature combinations across 100+ clients — maintaining separate builds for each combination is not feasible.
Some extensions (e.g., OpenTelemetry) provide negative runtime flags such as
quarkus.otel.sdk.disabled=false,which allows keeping the functionality in the build but activating it only when needed.
This seems quite reasonable, especially for those coming from frameworks like Spring, where runtime flexibility is common.
However, many Quarkus extensions resolve configuration strictly at build time.
A real-world example is named Redis clients. Some of our features define their own Redis connections, e.g.:
and then we inject them like this:
The dilemma:
If a feature is disabled for a particular client (or not yet configured), we must not connect to that Redis instance.
But if the client-specific Redis connection is missing (or dummy), our health checks fail.
If we try to obtain a RedisDataSource programmatically, it seems the bean is removed during the build phase — likely because there’s no direct injection for that named client, so it’s not retained in the final build.
We can’t simply disable the Redis health check globally (
quarkus.redis.health.enabled=false), since some Redis connections should be monitored.That means we’d have to write custom health checks or manage all Redis configurations manually, which defeats the simplicity of using Quarkus.
So my questions are:
What is the recommended Quarkus way to handle such cases — where we have dynamic, client-specific features but want to avoid build-time restrictions?
Is there a way to mark some named clients (like Redis) as unremovable or conditionally available at runtime?
Should we move more functionality to runtime initialization, or is there a Quarkus-native pattern for this kind of feature-flag-driven, multi-tenant setup?
Thank you in advance for your guidance!
Beta Was this translation helpful? Give feedback.
All reactions