@Factory public class NamedRedisClientFactory extends AbstractRedisClientFactory
RedisClient
instances from NamedRedisServersConfiguration
instances.Constructor and Description |
---|
NamedRedisClientFactory(io.micronaut.context.BeanLocator beanLocator,
io.lettuce.core.resource.ClientResources defaultClientResources) |
Modifier and Type | Method and Description |
---|---|
io.lettuce.core.RedisClient |
redisClient(NamedRedisServersConfiguration config,
java.util.List<ClientResourcesMutator> mutators)
Creates the
RedisClient from the configuration. |
io.lettuce.core.api.StatefulRedisConnection<java.lang.String,java.lang.String> |
redisConnection(NamedRedisServersConfiguration config)
Creates the
StatefulRedisConnection from the RedisClient . |
io.lettuce.core.pubsub.StatefulRedisPubSubConnection<java.lang.String,java.lang.String> |
redisPubSubConnection(NamedRedisServersConfiguration config)
Creates the
StatefulRedisPubSubConnection from the RedisClient . |
redisClient, redisClient, redisClient, redisConnection, redisPubSubConnection
public NamedRedisClientFactory(io.micronaut.context.BeanLocator beanLocator, @Primary @Nullable io.lettuce.core.resource.ClientResources defaultClientResources)
beanLocator
- The BeanLocatordefaultClientResources
- The ClientResources@Bean(preDestroy="shutdown") @EachBean(value=NamedRedisServersConfiguration.class) public io.lettuce.core.RedisClient redisClient(NamedRedisServersConfiguration config, @Nullable java.util.List<ClientResourcesMutator> mutators)
RedisClient
from the configuration.config
- The configurationmutators
- the list of mutatorsRedisClient
@Bean(preDestroy="close") @EachBean(value=NamedRedisServersConfiguration.class) public io.lettuce.core.api.StatefulRedisConnection<java.lang.String,java.lang.String> redisConnection(NamedRedisServersConfiguration config)
StatefulRedisConnection
from the RedisClient
.config
- The NamedRedisServersConfiguration
StatefulRedisConnection
@Bean(preDestroy="close") @EachBean(value=NamedRedisServersConfiguration.class) public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<java.lang.String,java.lang.String> redisPubSubConnection(NamedRedisServersConfiguration config)
StatefulRedisPubSubConnection
from the RedisClient
.config
- The NamedRedisServersConfiguration
StatefulRedisPubSubConnection