Package org.springframework.data.redis.connection

Examples of org.springframework.data.redis.connection.PoolConfig


    Jackson2JsonRedisSerializer<Person> jackson2JsonSerializer = new Jackson2JsonRedisSerializer<Person>(Person.class);
    Jackson2JsonRedisSerializer<String> jackson2JsonStringSerializer = new Jackson2JsonRedisSerializer<String>(
        String.class);
    StringRedisSerializer stringSerializer = new StringRedisSerializer();

    PoolConfig defaultPoolConfig = new PoolConfig();
    defaultPoolConfig.setMaxActive(1000);

    // create Jedis Factory
    ObjectFactory<String> stringFactory = new StringObjectFactory();
    ObjectFactory<Person> personFactory = new PersonObjectFactory();
    ObjectFactory<String> doubleFactory = new DoubleAsStringObjectFactory();
    ObjectFactory<String> longFactory = new LongAsStringObjectFactory();
    ObjectFactory<byte[]> rawFactory = new RawObjectFactory();

    JedisConnectionFactory jedisConnFactory = new JedisConnectionFactory();
    jedisConnFactory.getPoolConfig().setMaxTotal(defaultPoolConfig.getMaxTotal());
    jedisConnFactory.setUsePool(true);
    jedisConnFactory.setPort(SettingsUtils.getPort());
    jedisConnFactory.setHostName(SettingsUtils.getHost());
    jedisConnFactory.afterPropertiesSet();
View Full Code Here


    }
  }

  @Test
  public void testGetResourceValidate() {
    PoolConfig poolConfig = new PoolConfig();
    poolConfig.setTestOnBorrow(true);
    this.pool = new DefaultLettucePool(SettingsUtils.getHost(), SettingsUtils.getPort(), poolConfig);
    pool.afterPropertiesSet();
    RedisAsyncConnection<byte[], byte[]> client = pool.getResource();
    assertNotNull(client);
    client.close();
View Full Code Here

TOP

Related Classes of org.springframework.data.redis.connection.PoolConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.