Java Code Examples for org.apache.commons.pool2.impl.GenericObjectPoolConfig#setMinIdle()

The following examples show how to use org.apache.commons.pool2.impl.GenericObjectPoolConfig#setMinIdle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConnectionPool.java    From AsyncDao with MIT License 6 votes vote down vote up
public ConnectionPool(PoolConfiguration configuration, Vertx vertx) {
    this.vertx = vertx;
    this.executionContext = VertxEventLoopExecutionContext.create(vertx);
    this.borrowMaxWaitMillis = configuration.getBorrowMaxWaitMillis();
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    config.setMaxTotal(configuration.getMaxTotal());
    config.setMaxIdle(configuration.getMaxIdle());
    config.setMinIdle(configuration.getMinIdle());
    config.setMaxWaitMillis(0);
    pool = new GenericObjectPool<>(new ConnectionFactory(configuration.getConfig(), vertx), config);
    try {
        pool.preparePool();
    } catch (Exception e) {
        throw new RuntimeException("{init connectionpool error: {}}", e);
    }
}
 
Example 2
Source File: J2CacheSpringRedisAutoConfiguration.java    From J2Cache with Apache License 2.0 6 votes vote down vote up
private GenericObjectPoolConfig getGenericRedisPool(Properties props, String prefix) {
	GenericObjectPoolConfig cfg = new GenericObjectPoolConfig();
	cfg.setMaxTotal(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxTotal"), "-1")));
	cfg.setMaxIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxIdle"), "100")));
	cfg.setMaxWaitMillis(Integer.valueOf((String) props.getOrDefault(key(prefix, "maxWaitMillis"), "100")));
	cfg.setMinEvictableIdleTimeMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "minEvictableIdleTimeMillis"), "864000000")));
	cfg.setMinIdle(Integer.valueOf((String) props.getOrDefault(key(prefix, "minIdle"), "10")));
	cfg.setNumTestsPerEvictionRun(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "numTestsPerEvictionRun"), "10")));
	cfg.setLifo(Boolean.valueOf(props.getProperty(key(prefix, "lifo"), "false")));
	cfg.setSoftMinEvictableIdleTimeMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "softMinEvictableIdleTimeMillis"), "10")));
	cfg.setTestOnBorrow(Boolean.valueOf(props.getProperty(key(prefix, "testOnBorrow"), "true")));
	cfg.setTestOnReturn(Boolean.valueOf(props.getProperty(key(prefix, "testOnReturn"), "false")));
	cfg.setTestWhileIdle(Boolean.valueOf(props.getProperty(key(prefix, "testWhileIdle"), "true")));
	cfg.setTimeBetweenEvictionRunsMillis(
			Integer.valueOf((String) props.getOrDefault(key(prefix, "timeBetweenEvictionRunsMillis"), "300000")));
	cfg.setBlockWhenExhausted(Boolean.valueOf(props.getProperty(key(prefix, "blockWhenExhausted"), "false")));
	return cfg;
}
 
Example 3
Source File: RedisCommandsContainerBuilder.java    From bahir-flink with Apache License 2.0 6 votes vote down vote up
/**
 * Builds container for Redis Cluster environment.
 *
 * @param jedisClusterConfig configuration for JedisCluster
 * @return container for Redis Cluster environment
 * @throws NullPointerException if jedisClusterConfig is null
 */
public static RedisCommandsContainer build(FlinkJedisClusterConfig jedisClusterConfig) {
    Objects.requireNonNull(jedisClusterConfig, "Redis cluster config should not be Null");

    GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig();
    genericObjectPoolConfig.setMaxIdle(jedisClusterConfig.getMaxIdle());
    genericObjectPoolConfig.setMaxTotal(jedisClusterConfig.getMaxTotal());
    genericObjectPoolConfig.setMinIdle(jedisClusterConfig.getMinIdle());

    JedisCluster jedisCluster = new JedisCluster(jedisClusterConfig.getNodes(),
            jedisClusterConfig.getConnectionTimeout(),
            jedisClusterConfig.getConnectionTimeout(),
            jedisClusterConfig.getMaxRedirections(),
            jedisClusterConfig.getPassword(),
            genericObjectPoolConfig);
    return new RedisClusterContainer(jedisCluster);
}
 
Example 4
Source File: MultiLevelCacheMixTest.java    From jetcache with Apache License 2.0 6 votes vote down vote up
@Test
public void testWithJedis() {
    l1Cache = CaffeineCacheBuilder.createCaffeineCacheBuilder()
            .limit(10)
            .expireAfterWrite(1000, TimeUnit.MILLISECONDS)
            .keyConvertor(FastjsonKeyConvertor.INSTANCE)
            .buildCache();
    GenericObjectPoolConfig pc = new GenericObjectPoolConfig();
    pc.setMinIdle(1);
    pc.setMaxIdle(1);
    pc.setMaxTotal(2);
    JedisPool pool = new JedisPool(pc, "localhost", 6379);
    l2Cache = RedisCacheBuilder.createRedisCacheBuilder()
            .keyConvertor(FastjsonKeyConvertor.INSTANCE)
            .valueEncoder(JavaValueEncoder.INSTANCE)
            .valueDecoder(JavaValueDecoder.INSTANCE)
            .jedisPool(pool)
            .keyPrefix(new Random().nextInt() + "")
            .expireAfterWrite(1000, TimeUnit.MILLISECONDS)
            .buildCache();
    cache = MultiLevelCacheBuilder.createMultiLevelCacheBuilder().addCache(l1Cache, l2Cache).buildCache();
    testImpl();
}
 
Example 5
Source File: JedisHolder.java    From feeyo-redisproxy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private JedisPool initialize(String host, int port) {

		GenericObjectPoolConfig jedisPoolConfig = new GenericObjectPoolConfig();
		jedisPoolConfig.setMaxIdle(maxIdle);
		jedisPoolConfig.setMinIdle(minIdle);
		jedisPoolConfig.setTestOnBorrow(testOnBorrow);
		jedisPoolConfig.setTestOnReturn(testOnReturn);
		jedisPoolConfig.setTestWhileIdle(testWhileIdle);

		jedisPoolConfig.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
		jedisPoolConfig.setMinEvictableIdleTimeMillis(-1);
		jedisPoolConfig.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
		jedisPoolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);

		return new JedisPool(jedisPoolConfig, host, port, timeBetweenEvictionRunsMillis, null);
		
	}
 
Example 6
Source File: KafkaUDPConsumer.java    From datacollector with Apache License 2.0 6 votes vote down vote up
public void init() {
  executorService = (ThreadPoolExecutor) Executors.newFixedThreadPool(udpConfigBean.concurrency);
  int max = udpConfigBean.concurrency;
  int minIdle = Math.max(1, udpConfigBean.concurrency / 4);
  int maxIdle = udpConfigBean.concurrency / 2;
  GenericObjectPoolConfig kakfaPoolConfig = new GenericObjectPoolConfig();
  kakfaPoolConfig.setMaxTotal(udpConfigBean.concurrency);
  kakfaPoolConfig.setMinIdle(minIdle);
  kakfaPoolConfig.setMaxIdle(maxIdle);
  LOG.debug("Creating Kafka producer pool with max '{}' minIdle '{}' maxIdle '{}'", max, minIdle, maxIdle);
  kafkaProducerPool =
      new GenericObjectPool<>(new SdcKafkaProducerPooledObjectFactory(kafkaTargetConfig, DataFormat.BINARY),
          kakfaPoolConfig
      );
  GenericObjectPoolConfig serializerPoolConfig = new GenericObjectPoolConfig();
  serializerPoolConfig.setMaxTotal(udpConfigBean.concurrency);
  serializerPoolConfig.setMinIdle(udpConfigBean.concurrency);
  serializerPoolConfig.setMaxIdle(udpConfigBean.concurrency);
  udpSerializerPool = new GenericObjectPool<>(new UDPMessageSerializerPooledObjectFactory(), serializerPoolConfig);
  udpType = UDP_DATA_FORMAT_MAP.get(udpConfigBean.dataFormat);
  LOG.debug("Started, concurrency '{}'", udpConfigBean.concurrency);
}
 
Example 7
Source File: RedisCacheTest.java    From jetcache with Apache License 2.0 5 votes vote down vote up
@Test
public void testSimplePool() throws Exception {
    GenericObjectPoolConfig pc = new GenericObjectPoolConfig();
    pc.setMinIdle(2);
    pc.setMaxIdle(10);
    pc.setMaxTotal(10);
    JedisPool pool = new JedisPool(pc, "localhost", 6379);

    testWithPool(pool);
}
 
Example 8
Source File: CommonPool.java    From tunnel with Apache License 2.0 5 votes vote down vote up
private GenericObjectPoolConfig<T> newPoolConfig() {
    GenericObjectPoolConfig<T> config = new GenericObjectPoolConfig<>();
    config.setTestWhileIdle(true);
    config.setTestOnCreate(true);
    config.setTestOnBorrow(true);
    config.setTestOnReturn(false);
    config.setMaxTotal(100);
    config.setMinIdle(30);
    config.setMaxIdle(80);
    return config;
}
 
Example 9
Source File: TestLEEFParser.java    From datacollector with Apache License 2.0 5 votes vote down vote up
private GenericObjectPool<StringBuilder> getStringBuilderPool() {
  GenericObjectPoolConfig stringBuilderPoolConfig = new GenericObjectPoolConfig();
  stringBuilderPoolConfig.setMaxTotal(1);
  stringBuilderPoolConfig.setMinIdle(1);
  stringBuilderPoolConfig.setMaxIdle(1);
  stringBuilderPoolConfig.setBlockWhenExhausted(false);
  return new GenericObjectPool<>(new StringBuilderPoolFactory(1024), stringBuilderPoolConfig);
}
 
Example 10
Source File: DefaultConnectionProvider.java    From Openfire with Apache License 2.0 5 votes vote down vote up
@Override
public void start() {

    try {
        Class.forName(driver);
    } catch (final ClassNotFoundException e) {
        throw new RuntimeException("Unable to find JDBC driver " + driver, e);
    }

    final ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(serverURL, username, password);
    final PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, null);
    poolableConnectionFactory.setValidationQuery(testSQL);
    poolableConnectionFactory.setValidationQueryTimeout(testTimeout);
    poolableConnectionFactory.setMaxConnLifetimeMillis((long) (connectionTimeout * JiveConstants.DAY));

    final GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
    poolConfig.setTestOnBorrow(testBeforeUse);
    poolConfig.setTestOnReturn(testAfterUse);
    poolConfig.setMinIdle(minConnections);
    if( minConnections > GenericObjectPoolConfig.DEFAULT_MAX_IDLE )
    {
        poolConfig.setMaxIdle(minConnections);
    }
    poolConfig.setMaxTotal(maxConnections);
    poolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRuns);
    poolConfig.setSoftMinEvictableIdleTimeMillis(minIdleTime);
    poolConfig.setMaxWaitMillis(maxWaitTime);
    connectionPool = new GenericObjectPool<>(poolableConnectionFactory, poolConfig);
    poolableConnectionFactory.setPool(connectionPool);
    dataSource = new PoolingDataSource<>(connectionPool);
}
 
Example 11
Source File: TestRegexParser.java    From datacollector with Apache License 2.0 5 votes vote down vote up
private GenericObjectPool<StringBuilder> getStringBuilderPool() {
  GenericObjectPoolConfig stringBuilderPoolConfig = new GenericObjectPoolConfig();
  stringBuilderPoolConfig.setMaxTotal(1);
  stringBuilderPoolConfig.setMinIdle(1);
  stringBuilderPoolConfig.setMaxIdle(1);
  stringBuilderPoolConfig.setBlockWhenExhausted(false);
  return new GenericObjectPool<>(new StringBuilderPoolFactory(1024), stringBuilderPoolConfig);
}
 
Example 12
Source File: RedisAutoConfig.java    From unimall with Apache License 2.0 5 votes vote down vote up
@Bean
public GenericObjectPoolConfig lockPoolConfig() {
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    config.setMaxTotal(maxActive);
    config.setMaxIdle(maxIdle);
    config.setMinIdle(minIdle);
    config.setMaxWaitMillis(maxWait);
    return config;
}
 
Example 13
Source File: ClientKafkaMonitor.java    From Kafdrop with Apache License 2.0 5 votes vote down vote up
public void applyPoolProperties(GenericObjectPoolConfig<?> poolConfig,
                                KafkaConfiguration.PoolProperties poolProperties)
{
   poolConfig.setMinIdle(poolProperties.getMinIdle());
   poolConfig.setMaxIdle(poolProperties.getMaxIdle());
   poolConfig.setMaxTotal(poolProperties.getMaxTotal());
   poolConfig.setMaxWaitMillis(poolProperties.getMaxWaitMillis());
}
 
Example 14
Source File: PoolConfigs.java    From smtp-connection-pool with Apache License 2.0 5 votes vote down vote up
/**
 * Default {@link GenericObjectPoolConfig} config
 *  {@link GenericObjectPoolConfig#getTestOnBorrow} : true
 *  minIdle: 0
 *  maxIdle: 8
 *  maxTotal: 8
 *  maxWaitMillis: 10000
 *  minEvictableIdleTimeMillis: 5 minutes
 *  timeBetweenEvictionRunsMillis: 10 seconds
 *
 * @return
 */
public static GenericObjectPoolConfig standardConfig() {
  GenericObjectPoolConfig config = new GenericObjectPoolConfig();
  config.setTestOnBorrow(true);
  config.setMinIdle(0);
  config.setMaxIdle(8);
  config.setMaxTotal(8);

  config.setMinEvictableIdleTimeMillis(TimeUnit.MINUTES.toMillis(5));
  config.setTimeBetweenEvictionRunsMillis(10000);


  config.setMaxWaitMillis(10000);
  return config;
}
 
Example 15
Source File: TestTextCharDataParser.java    From datacollector with Apache License 2.0 5 votes vote down vote up
private GenericObjectPool<StringBuilder> getStringBuilderPool() {
  GenericObjectPoolConfig stringBuilderPoolConfig = new GenericObjectPoolConfig();
  stringBuilderPoolConfig.setMaxTotal(1);
  stringBuilderPoolConfig.setMinIdle(1);
  stringBuilderPoolConfig.setMaxIdle(1);
  stringBuilderPoolConfig.setBlockWhenExhausted(false);
  return new GenericObjectPool<>(new StringBuilderPoolFactory(1024), stringBuilderPoolConfig);
}
 
Example 16
Source File: HessianSerializePool.java    From Lottor with MIT License 5 votes vote down vote up
public HessianSerializePool(final int maxTotal, final int minIdle, final long maxWaitMillis, final long minEvictableIdleTimeMillis) {
    hessianPool = new GenericObjectPool<>(new HessianSerializeFactory());

    GenericObjectPoolConfig config = new GenericObjectPoolConfig();

    config.setMaxTotal(maxTotal);
    config.setMinIdle(minIdle);
    config.setMaxWaitMillis(maxWaitMillis);
    config.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);

    hessianPool.setConfig(config);
}
 
Example 17
Source File: CommonsPool2TargetSource.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Subclasses can override this if they want to return a specific Commons pool.
 * They should apply any configuration properties to the pool here.
 * <p>Default is a GenericObjectPool instance with the given pool size.
 * @return an empty Commons {@code ObjectPool}.
 * @see GenericObjectPool
 * @see #setMaxSize
 */
protected ObjectPool createObjectPool() {
	GenericObjectPoolConfig config = new GenericObjectPoolConfig();
	config.setMaxTotal(getMaxSize());
	config.setMaxIdle(getMaxIdle());
	config.setMinIdle(getMinIdle());
	config.setMaxWaitMillis(getMaxWait());
	config.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis());
	config.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis());
	config.setBlockWhenExhausted(isBlockWhenExhausted());
	return new GenericObjectPool(this, config);
}
 
Example 18
Source File: RedisSentinelTest.java    From cachecloud with Apache License 2.0 5 votes vote down vote up
@Test
    public void testSentinelExample() {
        JedisSentinelPool sentinelPool = null;

        // 使用默认配置
//        sentinelPool = ClientBuilder.redisSentinel(appId).build();

        /**
         * 自定义配置
         */
        GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
        poolConfig.setMaxIdle(GenericObjectPoolConfig.DEFAULT_MAX_IDLE * 3);
        poolConfig.setMinIdle(GenericObjectPoolConfig.DEFAULT_MIN_IDLE * 2);
        poolConfig.setJmxEnabled(true);
        poolConfig.setMaxWaitMillis(3000);

        sentinelPool = ClientBuilder.redisSentinel(appId)
                .setPoolConfig(poolConfig)
                .setConnectionTimeout(2000)
                .setSoTimeout(1000)
                .build();

        Jedis jedis = sentinelPool.getResource();
        jedis.set("key1", "1");
        assertEquals("2", jedis.incr("key1"));
        jedis.close();
    }
 
Example 19
Source File: RedisRegistry.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
public RedisRegistry(URL url) {
    super(url);
    if (url.isAnyHost()) {
        throw new IllegalStateException("registry address == null");
    }
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    config.setTestOnBorrow(url.getParameter("test.on.borrow", true));
    config.setTestOnReturn(url.getParameter("test.on.return", false));
    config.setTestWhileIdle(url.getParameter("test.while.idle", false));
    if (url.getParameter("max.idle", 0) > 0)
        config.setMaxIdle(url.getParameter("max.idle", 0));
    if (url.getParameter("min.idle", 0) > 0)
        config.setMinIdle(url.getParameter("min.idle", 0));
    if (url.getParameter("max.active", 0) > 0)
        config.setMaxTotal(url.getParameter("max.active", 0));
    if (url.getParameter("max.total", 0) > 0)
        config.setMaxTotal(url.getParameter("max.total", 0));
    if (url.getParameter("max.wait", url.getParameter("timeout", 0)) > 0)
        config.setMaxWaitMillis(url.getParameter("max.wait", url.getParameter("timeout", 0)));
    if (url.getParameter("num.tests.per.eviction.run", 0) > 0)
        config.setNumTestsPerEvictionRun(url.getParameter("num.tests.per.eviction.run", 0));
    if (url.getParameter("time.between.eviction.runs.millis", 0) > 0)
        config.setTimeBetweenEvictionRunsMillis(url.getParameter("time.between.eviction.runs.millis", 0));
    if (url.getParameter("min.evictable.idle.time.millis", 0) > 0)
        config.setMinEvictableIdleTimeMillis(url.getParameter("min.evictable.idle.time.millis", 0));

    String cluster = url.getParameter("cluster", "failover");
    if (!"failover".equals(cluster) && !"replicate".equals(cluster)) {
        throw new IllegalArgumentException("Unsupported redis cluster: " + cluster + ". The redis cluster only supported failover or replicate.");
    }
    replicate = "replicate".equals(cluster);

    List<String> addresses = new ArrayList<String>();
    addresses.add(url.getAddress());
    String[] backups = url.getParameter(Constants.BACKUP_KEY, new String[0]);
    if (backups != null && backups.length > 0) {
        addresses.addAll(Arrays.asList(backups));
    }

    for (String address : addresses) {
        int i = address.indexOf(':');
        String host;
        int port;
        if (i > 0) {
            host = address.substring(0, i);
            port = Integer.parseInt(address.substring(i + 1));
        } else {
            host = address;
            port = DEFAULT_REDIS_PORT;
        }
        this.jedisPools.put(address, new JedisPool(config, host, port,
                url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT), StringUtils.isEmpty(url.getPassword()) ? null : url.getPassword(),
                url.getParameter("db.index", 0)));
    }

    this.reconnectPeriod = url.getParameter(Constants.REGISTRY_RECONNECT_PERIOD_KEY, Constants.DEFAULT_REGISTRY_RECONNECT_PERIOD);
    String group = url.getParameter(Constants.GROUP_KEY, DEFAULT_ROOT);
    if (!group.startsWith(Constants.PATH_SEPARATOR)) {
        group = Constants.PATH_SEPARATOR + group;
    }
    if (!group.endsWith(Constants.PATH_SEPARATOR)) {
        group = group + Constants.PATH_SEPARATOR;
    }
    this.root = group;

    this.expirePeriod = url.getParameter(Constants.SESSION_TIMEOUT_KEY, Constants.DEFAULT_SESSION_TIMEOUT);
    this.expireFuture = expireExecutor.scheduleWithFixedDelay(new Runnable() {
        @Override
        public void run() {
            try {
                deferExpired(); // Extend the expiration time
            } catch (Throwable t) { // Defensive fault tolerance
                logger.error("Unexpected exception occur at defer expire time, cause: " + t.getMessage(), t);
            }
        }
    }, expirePeriod / 2, expirePeriod / 2, TimeUnit.MILLISECONDS);
}
 
Example 20
Source File: JedisPoolTest.java    From feeyo-redisproxy with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static void main(String[] args) throws InterruptedException {
	// 连接池中最大空闲的连接数
	int maxIdle = 100;
	int minIdle = 20;

	// 当调用borrow Object方法时,是否进行有效性检查
	boolean testOnBorrow = false;

	// 当调用return Object方法时,是否进行有效性检查
	boolean testOnReturn = false;

	// 如果为true,表示有一个idle object evitor线程对idle
	// object进行扫描,如果validate失败,此object会被从pool中drop掉
	// TODO: 这一项只有在timeBetweenEvictionRunsMillis大于0时才有意义
	boolean testWhileIdle = true;

	// 对于“空闲链接”检测线程而言,每次检测的链接资源的个数.(jedis 默认设置成-1)
	int numTestsPerEvictionRun = -1;

	// 连接空闲的最小时间,达到此值后空闲连接将可能会被移除。负值(-1)表示不移除
	int minEvictableIdleTimeMillis = 60 * 1000;

	// “空闲链接”检测线程,检测的周期,毫秒数。如果为负值,表示不运行“检测线程”。默认为-1
	int timeBetweenEvictionRunsMillis = 30 * 1000;

	GenericObjectPoolConfig jedisPoolConfig = new GenericObjectPoolConfig();
	jedisPoolConfig.setMaxIdle(maxIdle);
	jedisPoolConfig.setMinIdle(minIdle);
	jedisPoolConfig.setTestOnBorrow(testOnBorrow);
	jedisPoolConfig.setTestOnReturn(testOnReturn);
	jedisPoolConfig.setTestWhileIdle(testWhileIdle);

	jedisPoolConfig.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
	jedisPoolConfig.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
	jedisPoolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);

	JedisPool jedisPool = new JedisPool(jedisPoolConfig, "127.0.0.1", 8066, 30000, null);
	while (true) {
		JedisConnection jc = null;
		try {
			jc = jedisPool.getResource();
			jc.sendCommand(RedisCommand.AUTH, "pwd01");
			System.out.println(jc.getStatusCodeReply());
			jc.sendCommand(RedisCommand.GET, "tt");
			System.out.println(jc.getStatusCodeReply());
		} catch (Exception e) {
			
		} finally {
			if (jc != null)
				jc.close();
		}
		Thread.sleep(5000);
	}
	
}