Class DefaultRedisClusterClientFactory

java.lang.Object
io.micronaut.configuration.lettuce.DefaultRedisClusterClientFactory

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

    • DefaultRedisClusterClientFactory

      public DefaultRedisClusterClientFactory()
  • 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<String,String> redisConnection(@Primary io.lettuce.core.cluster.RedisClusterClient redisClient)
      Establish redis connection.
      Parameters:
      redisClient - client.
      Returns:
      connection
    • redisPubSubConnection

      @Bean(preDestroy="close") @Singleton public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<String,String> redisPubSubConnection(@Primary io.lettuce.core.cluster.RedisClusterClient redisClient)
      Parameters:
      redisClient - redisClient
      Returns:
      connection