Interface RedisBuildTimeConfig


@ConfigMapping(prefix="quarkus.redis") @ConfigRoot(phase=BUILD_TIME) public interface RedisBuildTimeConfig
  • Method Summary

    Modifier and Type
    Method
    Description
    @WithUnnamedKey("<default>") Map<String,RedisClientBuildTimeConfig>
    Configures the Redis clients.
    default List<String>
    Returns a List of Redis Client names.
    boolean
    Whether a health check is published in case the smallrye-health extension is present.
  • Method Details

    • clients

      @WithParentName @WithDefaults @WithUnnamedKey("<default>") @ConfigDocMapKey("redis-client-name") @WithUnnamedKey("<default>") Map<String,RedisClientBuildTimeConfig> clients()
      Configures the Redis clients.

      The default client does not have a name, and it is configured as:

       quarkus.redis.hosts = redis://localhost:6379
       
      And then use Inject to inject the client:
       @Inject
       RedisAPI redis;
       

      Named clients must be identified to select the right client:

       quarkus.redis.client1.hosts = redis://localhost:6379
       quarkus.redis.client2.hosts = redis://localhost:6380
       
      And then use the RedisClientName annotation to select any of the beans:
      • Redis
      • Redis
      • RedisAPI
      • RedisAPI
      • RedisDataSource
      • ReactiveRedisDataSource
      And inject the client:
       @RedisClientName("client1")
       @Inject
       RedisAPI redis;
       
    • clientsNames

      default List<String> clientsNames()
      Returns a List of Redis Client names. The first element of the list is the default Redis Client if available. The remaining order is unspecified.
      Returns:
      a List of Redis Client names
    • healthEnabled

      @WithName("health.enabled") @WithDefault("true") boolean healthEnabled()
      Whether a health check is published in case the smallrye-health extension is present.