private JedisPoolConfig onPoolConfig(final byte WHEN_EXHAUSTED_FAIL, String maxActivePerNode, String maxIdlePerNode, String minIdlePerNode, String maxTotal) { if (!StringUtils.isBlank(maxActivePerNode) && StringUtils.isNumeric(maxActivePerNode)) { logger.info("configuring connection pool"); JedisPoolConfig poolConfig = new JedisPoolConfig(); if (maxActivePerNode != null && StringUtils.isNumeric(maxActivePerNode)) { poolConfig.setMaxActive(Integer.valueOf(maxActivePerNode)); } if (maxIdlePerNode != null && StringUtils.isNumeric(maxIdlePerNode)) { poolConfig.setMaxIdle(Integer.valueOf(maxIdlePerNode)); } if (minIdlePerNode != null && StringUtils.isNumeric(minIdlePerNode)) { poolConfig.setMinIdle(Integer.parseInt(minIdlePerNode)); } if (maxActivePerNode != null && StringUtils.isNumeric(maxActivePerNode)) { poolConfig.setWhenExhaustedAction(WHEN_EXHAUSTED_FAIL); } return poolConfig; } return null; }
public JedisPoolBuilder() { this.poolConfig.setMaxIdle(1); this.poolConfig.setTestWhileIdle(true); this.poolConfig.setTestOnBorrow(true); this.poolConfig.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_GROW); }
config.setMinIdle(getMinIdle()); config.setMaxWait(getMaxWait()); config.setWhenExhaustedAction((byte)getWhenExhaustedAction()); config.setTestOnBorrow(getTestOnBorrow()); config.setTestOnReturn(getTestOnReturn());
config.setMinIdle(getMinIdle()); config.setMaxWait(getMaxWait()); config.setWhenExhaustedAction((byte)getWhenExhaustedAction()); config.setTestOnBorrow(getTestOnBorrow()); config.setTestOnReturn(getTestOnReturn());