Class NamedRedisClientFactory<K,V>
java.lang.Object
io.micronaut.configuration.lettuce.AbstractRedisClientFactory<K,V>
io.micronaut.configuration.lettuce.NamedRedisClientFactory<K,V>
- Type Parameters:
K
- Key typeV
- Value type
A factory bean for constructing
RedisClient
instances from NamedRedisServersConfiguration
instances.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.configuration.lettuce.AbstractRedisClientFactory
defaultCodec
-
Constructor Summary
ConstructorDescriptionNamedRedisClientFactory
(io.micronaut.context.BeanLocator beanLocator, @Nullable io.lettuce.core.resource.ClientResources defaultClientResources, io.lettuce.core.codec.RedisCodec<K, V> codec) -
Method Summary
Modifier and TypeMethodDescriptionio.lettuce.core.RedisClient
redisClient
(NamedRedisServersConfiguration config, @Nullable List<ClientResourcesMutator> mutators) Creates theRedisClient
from the configuration.Creates theStatefulRedisConnection
from theRedisClient
.Creates theStatefulRedisPubSubConnection
from theRedisClient
.Methods inherited from class io.micronaut.configuration.lettuce.AbstractRedisClientFactory
redisClient, redisClient, redisConnection, redisPubSubConnection
-
Constructor Details
-
NamedRedisClientFactory
public NamedRedisClientFactory(io.micronaut.context.BeanLocator beanLocator, @Primary @Nullable @Nullable io.lettuce.core.resource.ClientResources defaultClientResources, @Primary io.lettuce.core.codec.RedisCodec<K, V> codec) - Parameters:
beanLocator
- The BeanLocatordefaultClientResources
- The ClientResourcescodec
- The RedisCodec
-
-
Method Details
-
redisClient
@Bean(preDestroy="shutdown") @EachBean(NamedRedisServersConfiguration.class) public io.lettuce.core.RedisClient redisClient(NamedRedisServersConfiguration config, @Nullable @Nullable List<ClientResourcesMutator> mutators) Creates theRedisClient
from the configuration.- Parameters:
config
- The configurationmutators
- the list of mutators- Returns:
- The
RedisClient
-
redisConnection
@Bean(preDestroy="close") @EachBean(NamedRedisServersConfiguration.class) public io.lettuce.core.api.StatefulRedisConnection<K,V> redisConnection(NamedRedisServersConfiguration config) Creates theStatefulRedisConnection
from theRedisClient
.- Parameters:
config
- TheNamedRedisServersConfiguration
- Returns:
- The
StatefulRedisConnection
-
redisPubSubConnection
@Bean(preDestroy="close") @EachBean(NamedRedisServersConfiguration.class) public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<K,V> redisPubSubConnection(NamedRedisServersConfiguration config) Creates theStatefulRedisPubSubConnection
from theRedisClient
.- Parameters:
config
- TheNamedRedisServersConfiguration
- Returns:
- The
StatefulRedisPubSubConnection
-