use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class RedisConnectionFactoryConfigWithServiceConfig method pool30Wait300_timeout20.
@Bean
public RedisConnectionFactory pool30Wait300_timeout20() {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("timeout", 20);
PoolConfig poolConfig = new PoolConfig(30, 300);
RedisConnectionFactoryConfig serviceConfig = new RedisConnectionFactoryConfig(poolConfig, properties);
return connectionFactory().redisConnectionFactory("my-service", serviceConfig);
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class GenericServiceWithConnectorType method myServiceWithTypeWithServiceNameAndConfig.
@Bean
public DataSource myServiceWithTypeWithServiceNameAndConfig() {
PoolConfig poolConfig = new PoolConfig(20, 200);
ConnectionConfig connectionConfig = new ConnectionConfig("sessionVariables=sql_mode='ANSI';characterEncoding=UTF-8");
DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig);
return connectionFactory().service("my-service", DataSource.class, serviceConfig);
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class RedisConnectionFactoryConfigWithServiceConfig method pool20Wait200.
@Bean
public RedisConnectionFactory pool20Wait200() {
PoolConfig poolConfig = new PoolConfig(20, 200);
PooledServiceConnectorConfig serviceConfig = new PooledServiceConnectorConfig(poolConfig);
return connectionFactory().redisConnectionFactory("my-service", serviceConfig);
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class RedisConnectionFactoryConfigWithServiceConfig method pool5_30Wait3000.
@Bean
public RedisConnectionFactory pool5_30Wait3000() {
PoolConfig poolConfig = new PoolConfig(5, 30, 3000);
PooledServiceConnectorConfig serviceConfig = new RedisConnectionFactoryConfig(poolConfig);
return connectionFactory().redisConnectionFactory("my-service", serviceConfig);
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class AbstractDataSourceCreatorTest method cloudDataSourceCreationWithConfig.
@Test
public void cloudDataSourceCreationWithConfig() throws Exception {
SI relationalServiceInfo = createServiceInfo();
PoolConfig poolConfig = new PoolConfig("5", 100);
ConnectionConfig connectionConfig = new ConnectionConfig("foo=bar");
List<String> pooledDataSource = Collections.singletonList(BasicDbcpPooledDataSourceCreator.class.getSimpleName());
DataSourceConfig config = new DataSourceConfig(poolConfig, connectionConfig, pooledDataSource);
DataSource dataSource = getCreator().create(relationalServiceInfo, config);
assertDataSourceProperties(relationalServiceInfo, dataSource);
DataSourceCloudConfigTestHelper.assertPoolProperties(dataSource, 5, 0, 100);
Properties connectionProp = new Properties();
connectionProp.put("foo", "bar");
assertConnectionProperties(dataSource, connectionProp);
}
Aggregations