quarkusio/quarkus · error · UnsupportedOperationException
The Reactive Redis Client must be injected
Error message
The Reactive Redis Client must be injected
What it means
ReactiveRedisClient.createClient(name) is a static placeholder method that deliberately throws UnsupportedOperationException: creating a reactive Redis client programmatically is not supported; instances must be obtained via CDI injection so Quarkus can wire configuration, lifecycle, and Dev Services.
Source
Thrown at extensions/redis-client/runtime/src/main/java/io/quarkus/redis/client/reactive/ReactiveRedisClient.java:38
*/
@Deprecated
public interface ReactiveRedisClient {
/**
* Creates the {@link RedisClient} using the default redis client configuration
*
* @return {@link ReactiveRedisClient} - the default reactive redis client
*/
static ReactiveRedisClient createClient() {
return createClient(DEFAULT_CLIENT);
}
/**
* Creates the {@link RedisClient} using the named redis client configuration
*
* @return {@link ReactiveRedisClient} - the named reactive redis client
*/
static ReactiveRedisClient createClient(String name) {
throw new UnsupportedOperationException("The Reactive Redis Client must be injected");
}
void close();
Uni<Response> append(String arg0, String arg1);
Response appendAndAwait(String arg0, String arg1);
Uni<Response> asking();
Response askingAndAwait();
Uni<Response> auth(List<String> args);
Response authAndAwait(List<String> args);
Uni<Response> bgrewriteaof();
View on GitHub (pinned to e1c734241f)
Solutions
- Inject the client instead: @Inject ReactiveRedisClient client (or use @RedisClientName("my") qualifier for named clients)
- Use RedisClient/ReactiveRedisAPI programmatic creation if truly needed via RedisDataSource or the Vert.x Redis API with explicit connection config
- Inject RedisDataSource and build the reactive client through the supported runtime APIs
- Update tests to use QuarkusTest with injected clients rather than static factories
Example fix
// before
ReactiveRedisClient client = ReactiveRedisClient.createClient("default");
// after
@Inject
@RedisClientName("default")
ReactiveRedisClient client; Defensive patterns
Strategy: type-guard
Validate before calling
// never call the static factory; verify injection instead Objects.requireNonNull(client, "ReactiveRedisClient must be injected via CDI");
Prevention
- Use @Inject (or constructor injection) for ReactiveRedisClient everywhere
- Do not copy createClient patterns from RedisClient-style APIs
- Use QuarkusTest with injected clients in tests
When it happens
Trigger: Calling ReactiveRedisClient.createClient("...") in application code, e.g. copied from the RedisClient (non-reactive) API pattern or from an IDE completion.
Common situations: Porting code written for RedisClient.createClient style APIs; writing tests that attempt manual client construction; misunderstanding that the static method is an actual factory.
Related errors
- Use the 'OidcClientCommonConfigBuilder.CredentialsBuilder#bu
- Unable to find redis host provider identified with " + name
- Unable to find redis host provider
- A generic type is not allowed here; try creating a subclass
- Build item class must be leaf (final) types: %s
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f04a4bdb88c8a415.
Report an issue: GitHub.