This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@ComponentScan(basePackages = "com.rest.dao") | |
@ImportResource("classpath:app-config.xml") | |
public class DaoConfig { | |
@Bean | |
public DataSource dataSource() { | |
HikariConfig hikariConfig = new HikariConfig(); | |
hikariConfig.setDriverClassName("org.h2.Driver"); | |
hikariConfig.setJdbcUrl("jdbc:h2:~/billionaire"); | |
hikariConfig.setUsername("sa"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public HttpClient httpClient(SSLContext sslContext) { | |
return HttpClients.custom() | |
.setMaxConnPerRoute(30) | |
.setMaxConnTotal(60) | |
.setSSLContext(sslContext).build(); | |
} | |
@Bean | |
public ClientHttpRequestFactory clientHttpRequestFactory(HttpClient httpClient) { | |
return new HttpComponentsClientHttpRequestFactory(httpClient); |