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 PooledDataSourceCreatorsTest method pooledDataSourceCreationDefault.
@Test
public void pooledDataSourceCreationDefault() throws Exception {
PoolConfig poolConfig = new PoolConfig(MIN_POOL_SIZE, MAX_POOL_SIZE, MAX_WAIT_TIME);
ConnectionConfig connectionConfig = new ConnectionConfig(CONNECTION_PROPERTIES_STRING);
DataSourceConfig config = new DataSourceConfig(poolConfig, connectionConfig);
DataSource ds = createMysqlDataSource(config);
assertTomcatJdbcDataSource(ds, true);
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class PooledServiceConnectorConfigurer method configure.
@Override
public SC configure(SC serviceConnector, SCC config) {
if (config != null) {
BeanWrapper target = new BeanWrapperImpl(serviceConnector);
PoolConfig poolConfig = config.getPoolConfig();
if (poolConfig != null) {
BeanWrapper poolSource = new BeanWrapperImpl(poolConfig);
setCorrespondingProperties(target, poolSource);
}
}
return serviceConnector;
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class PooledDataSourceCreatorsTest method createMysqlDataSourceWithPooledName.
private DataSource createMysqlDataSourceWithPooledName(String pooledDataSourceName) {
List<String> dataSourceNames = Collections.singletonList(pooledDataSourceName);
PoolConfig poolConfig = new PoolConfig(MIN_POOL_SIZE, MAX_POOL_SIZE, MAX_WAIT_TIME);
ConnectionConfig connectionConfig = new ConnectionConfig(CONNECTION_PROPERTIES_STRING);
DataSourceConfig config = new DataSourceConfig(poolConfig, connectionConfig, dataSourceNames);
return createMysqlDataSource(config);
}
use of org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig in project spring-cloud-connectors by spring-cloud.
the class DatasourceConfigWithServiceConfig method dataSourceWithPoolConfig.
@Bean
public DataSource dataSourceWithPoolConfig() {
PoolConfig poolConfig = new PoolConfig(5, 30, 3000);
DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, null, basicDbcpConnectionPool());
return connectionFactory().dataSource("my-service", serviceConfig);
}
Aggregations