Class DefaultRedisClusterClientFactory<K,V>

java.lang.Object
io.micronaut.configuration.lettuce.DefaultRedisClusterClientFactory<K,V>
Type Parameters:
K - Key type
V - Value type

@Requires(property="redis.uris") @Singleton @Factory public class DefaultRedisClusterClientFactory<K,V> extends Object
Allows connecting to a Redis cluster via the "redis.uris" setting.
Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • DefaultRedisClusterClientFactory

      public DefaultRedisClusterClientFactory(@Primary io.lettuce.core.codec.RedisCodec<K,V> codec)
  • 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 - config
      defaultClientResources - default ClientResources
      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 - config
      defaultClientResources - default ClientResources
      mutators - The list of mutators
      Returns:
      client
      Since:
      6.1.0
    • redisConnection

      @Bean(preDestroy="close") @Singleton @Primary public io.lettuce.core.cluster.api.StatefulRedisClusterConnection<K,V> 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<K,V> 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<K,V> redisPubSubConnection(@Primary io.lettuce.core.cluster.RedisClusterClient redisClient)
      Parameters:
      redisClient - redisClient
      Returns:
      connection