All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.bitcoco.jsk.redis.RedisAutoConfiguration Maven / Gradle / Ivy

package ca.bitcoco.jsk.redis;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "bitcoco.jsk.redis")
@ConditionalOnProperty(name = "bitcoco.jsk.redis.enabled", havingValue = "true")
public class RedisAutoConfiguration {

    @Value("${bitcoco.jsk.redis.host:localhost}")
    private String redis_host;

    @Bean
    @ConditionalOnMissingBean
    public RedisCacheClient getRedisCacheClient() {
        return new RedisCacheClient(redis_host);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy