Interface RedisConfig
@ConfigMapping(prefix="quarkus.redis")
@ConfigRoot(phase=RUN_TIME)
public interface RedisConfig
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@WithUnnamedKey("<default>") Map<String, RedisClientConfig> clients()Configures the Redis clients.static StringgetPropertyName(String name, String attribute) static booleanisDefaultClient(String name)
-
Field Details
-
DEFAULT_CLIENT_NAME
- See Also:
-
HOSTS
- See Also:
-
HOSTS_PROVIDER_NAME
- See Also:
-
-
Method Details
-
clients
@WithParentName @WithDefaults @WithUnnamedKey("<default>") @ConfigDocMapKey("redis-client-name") @WithUnnamedKey("<default>") Map<String,RedisClientConfig> clients()Configures the Redis clients.The default client does not have a name, and it is configured as:
quarkus.redis.hosts = redis://localhost:6379
And then useInjectto inject the client:@Inject RedisAPI redis;
Named clients must be identified to select the right client:
quarkus.redis.client1.hosts = redis://localhost:6379 quarkus.redis.client2.hosts = redis://localhost:6380
And then use theRedisClientNameannotation to select any of the beans:RedisRedisRedisAPIRedisAPIRedisDataSourceReactiveRedisDataSource
@RedisClientName("client1") @Inject RedisAPI redis; -
isDefaultClient
-
getPropertyName
-