Class DefaultRedisClientFactory<K,V>
java.lang.Object
io.micronaut.configuration.lettuce.AbstractRedisClientFactory<K,V>
io.micronaut.configuration.lettuce.DefaultRedisClientFactory<K,V>
- Type Parameters:
K
- Key typeV
- Value type
@Requires(beans=DefaultRedisConfiguration.class) @Requires(missingProperty="redis.uris")
@Singleton
@Factory
public class DefaultRedisClientFactory<K,V>
extends AbstractRedisClientFactory<K,V>
Factory for the default
RedisClient
. Creates the injectable Primary
bean.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.configuration.lettuce.AbstractRedisClientFactory
defaultCodec
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.lettuce.core.RedisClient
redisClient
(AbstractRedisConfiguration config, @Nullable io.lettuce.core.resource.ClientResources defaultClientResources, @Nullable List<ClientResourcesMutator> mutators) Creates theRedisClient
from the configuration.redisConnection
(io.lettuce.core.RedisClient redisClient) Deprecated, for removal: This API element is subject to removal in a future version.redisConnection
(io.lettuce.core.RedisClient redisClient, AbstractRedisConfiguration config) Creates theStatefulRedisConnection
from theRedisClient
.redisPubSubConnection
(io.lettuce.core.RedisClient redisClient) Creates theStatefulRedisPubSubConnection
from theRedisClient
.Methods inherited from class io.micronaut.configuration.lettuce.AbstractRedisClientFactory
redisClient, redisConnection, redisPubSubConnection
-
Constructor Details
-
DefaultRedisClientFactory
-
-
Method Details
-
redisClient
@Bean(preDestroy="shutdown") @Singleton @Primary public io.lettuce.core.RedisClient redisClient(@Primary AbstractRedisConfiguration config, @Nullable @Primary @Nullable io.lettuce.core.resource.ClientResources defaultClientResources, @Nullable @Nullable List<ClientResourcesMutator> mutators) Description copied from class:AbstractRedisClientFactory
Creates theRedisClient
from the configuration.- Overrides:
redisClient
in classAbstractRedisClientFactory<K,
V> - Parameters:
config
- The configurationdefaultClientResources
- The ClientResourcesmutators
- The list of mutators- Returns:
- The
RedisClient
-
redisConnection
@Bean(preDestroy="close") @Singleton @Primary public io.lettuce.core.api.StatefulRedisConnection<K,V> redisConnection(@Primary io.lettuce.core.RedisClient redisClient, AbstractRedisConfiguration config) Creates theStatefulRedisConnection
from theRedisClient
.- Parameters:
redisClient
- TheRedisClient
config
- The config.- Returns:
- The
StatefulRedisConnection
- Since:
- 6.5.0
-
redisConnection
@Deprecated(since="6.5.0", forRemoval=true) public io.lettuce.core.api.StatefulRedisConnection<K,V> redisConnection(@Primary io.lettuce.core.RedisClient redisClient) Deprecated, for removal: This API element is subject to removal in a future version.Creates theStatefulRedisConnection
from theRedisClient
.- Parameters:
redisClient
- TheRedisClient
- Returns:
- The
StatefulRedisConnection
-
redisPubSubConnection
@Bean(preDestroy="close") @Singleton public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<K,V> redisPubSubConnection(@Primary io.lettuce.core.RedisClient redisClient) Creates theStatefulRedisPubSubConnection
from theRedisClient
.- Parameters:
redisClient
- TheRedisClient
- Returns:
- The
StatefulRedisPubSubConnection
-
redisConnection(RedisClient, AbstractRedisConfiguration)
instead