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 type
V - 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
  • Constructor Details

    • DefaultRedisClientFactory

      public DefaultRedisClientFactory(@Primary io.lettuce.core.codec.RedisCodec<K,V> codec)
  • 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 the RedisClient from the configuration.
      Overrides:
      redisClient in class AbstractRedisClientFactory<K,V>
      Parameters:
      config - The configuration
      defaultClientResources - The ClientResources
      mutators - 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 the StatefulRedisConnection from the RedisClient.
      Parameters:
      redisClient - The RedisClient
      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 the StatefulRedisConnection from the RedisClient.
      Parameters:
      redisClient - The RedisClient
      Returns:
      The StatefulRedisConnection
    • redisPubSubConnection

      @Bean(preDestroy="close") @Singleton public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<K,V> redisPubSubConnection(@Primary io.lettuce.core.RedisClient redisClient)
      Creates the StatefulRedisPubSubConnection from the RedisClient.
      Parameters:
      redisClient - The RedisClient
      Returns:
      The StatefulRedisPubSubConnection