Search in sources :

Example 1 with InstrumentedJedisPool

use of com.netflix.spinnaker.kork.jedis.telemetry.InstrumentedJedisPool in project kork by spinnaker.

the class JedisPoolFactory method build.

public Pool<Jedis> build(String name, JedisDriverProperties properties, GenericObjectPoolConfig objectPoolConfig) {
    if (properties.connection == null || "".equals(properties.connection)) {
        throw new MissingRequiredConfiguration("Jedis client must have a connection defined");
    }
    RedisClientConnectionProperties cxp = new RedisClientConnectionProperties(URI.create(properties.connection));
    GenericObjectPoolConfig poolConfig = Optional.ofNullable(properties.poolConfig).orElse(objectPoolConfig);
    return new InstrumentedJedisPool(registry, // offerings
    new JedisPool(poolConfig, cxp.addr(), cxp.port(), properties.timeoutMs, cxp.password(), cxp.database(), null, cxp.isSSL()), name);
}
Also used : MissingRequiredConfiguration(com.netflix.spinnaker.kork.jedis.exception.MissingRequiredConfiguration) GenericObjectPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig) InstrumentedJedisPool(com.netflix.spinnaker.kork.jedis.telemetry.InstrumentedJedisPool) JedisPool(redis.clients.jedis.JedisPool) InstrumentedJedisPool(com.netflix.spinnaker.kork.jedis.telemetry.InstrumentedJedisPool)

Aggregations

MissingRequiredConfiguration (com.netflix.spinnaker.kork.jedis.exception.MissingRequiredConfiguration)1 InstrumentedJedisPool (com.netflix.spinnaker.kork.jedis.telemetry.InstrumentedJedisPool)1 GenericObjectPoolConfig (org.apache.commons.pool2.impl.GenericObjectPoolConfig)1 JedisPool (redis.clients.jedis.JedisPool)1