Class DefaultRedisClusterClientFactory
java.lang.Object
io.micronaut.configuration.lettuce.DefaultRedisClusterClientFactory
@Requires(property="redis.uris")
@Singleton
@Factory
public class DefaultRedisClusterClientFactory
extends Object
Allows connecting to a Redis cluster via the
"redis.uris"
setting.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.lettuce.core.cluster.RedisClusterClient
redisClient
(AbstractRedisConfiguration config, @Nullable io.lettuce.core.resource.ClientResources defaultClientResources) Deprecated, for removal: This API element is subject to removal in a future version.io.lettuce.core.cluster.RedisClusterClient
redisClient
(AbstractRedisConfiguration config, @Nullable io.lettuce.core.resource.ClientResources defaultClientResources, @Nullable List<ClientResourcesMutator> mutators) Create the client based on config URIs and optional client resource mutators.redisConnection
(io.lettuce.core.cluster.RedisClusterClient redisClient) Deprecated, for removal: This API element is subject to removal in a future version.redisConnection
(io.lettuce.core.cluster.RedisClusterClient redisClient, AbstractRedisConfiguration config) Establish redis connection.redisPubSubConnection
(io.lettuce.core.cluster.RedisClusterClient redisClient)
-
Constructor Details
-
DefaultRedisClusterClientFactory
public DefaultRedisClusterClientFactory()
-
-
Method Details
-
redisClient
@Deprecated(since="6.1.0", forRemoval=true) public io.lettuce.core.cluster.RedisClusterClient redisClient(AbstractRedisConfiguration config, @Nullable @Nullable io.lettuce.core.resource.ClientResources defaultClientResources) Deprecated, for removal: This API element is subject to removal in a future version.Create the client based on config URIs.- Parameters:
config
- configdefaultClientResources
- defaultClientResources
- Returns:
- client
-
redisClient
@Bean(preDestroy="shutdown") @Singleton @Primary public io.lettuce.core.cluster.RedisClusterClient redisClient(@Primary AbstractRedisConfiguration config, @Primary @Nullable @Nullable io.lettuce.core.resource.ClientResources defaultClientResources, @Nullable @Nullable List<ClientResourcesMutator> mutators) Create the client based on config URIs and optional client resource mutators.- Parameters:
config
- configdefaultClientResources
- defaultClientResources
mutators
- The list of mutators- Returns:
- client
- Since:
- 6.1.0
-
redisConnection
@Bean(preDestroy="close") @Singleton @Primary public io.lettuce.core.cluster.api.StatefulRedisClusterConnection<String,String> redisConnection(@Primary io.lettuce.core.cluster.RedisClusterClient redisClient, @Primary AbstractRedisConfiguration config) Establish redis connection.- Parameters:
redisClient
- client.config
- config.- Returns:
- connection
- Since:
- 6.5.0
-
redisConnection
@Deprecated(since="6.5.0", forRemoval=true) public io.lettuce.core.cluster.api.StatefulRedisClusterConnection<String,String> redisConnection(@Primary io.lettuce.core.cluster.RedisClusterClient redisClient) Deprecated, for removal: This API element is subject to removal in a future version.Establish redis connection.- Parameters:
redisClient
- client.- Returns:
- connection
-
redisPubSubConnection
@Bean(preDestroy="close") @Singleton public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<String,String> redisPubSubConnection(@Primary io.lettuce.core.cluster.RedisClusterClient redisClient) - Parameters:
redisClient
- redisClient- Returns:
- connection
-
redisClient(AbstractRedisConfiguration, ClientResources, List)
instead