use of com.netflix.spinnaker.kork.jedis.exception.MissingRequiredConfiguration in project kork by spinnaker.
the class JedisPoolFactory method build.
public Pool<Jedis> build(String name, JedisDriverProperties properties) {
if (properties.connection == null || "".equals(properties.connection)) {
throw new MissingRequiredConfiguration("Jedis client must have a connection defined");
}
URI redisConnection = URI.create(properties.connection);
String host = redisConnection.getHost();
int port = redisConnection.getPort() == -1 ? Protocol.DEFAULT_PORT : redisConnection.getPort();
int database = parseDatabase(redisConnection.getPath());
String password = parsePassword(redisConnection.getUserInfo());
GenericObjectPoolConfig objectPoolConfig = properties.poolConfig;
return new JedisPool(objectPoolConfig, host, port, properties.timeoutMs, password, database, name);
}
use of com.netflix.spinnaker.kork.jedis.exception.MissingRequiredConfiguration 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);
}
Aggregations