title: How to override default connection pool limit in spring boot 2.0.x
body: <p>In my project we are using spring boot 2.0.3.Release. We have configured multiple data sources, by default spring boot picks Hikari datasource for connection pool. Below is my code.</p>
  
  <p>application.properties</p>
  
  <pre><code>first.datasource.jdbcUrl=jdbc:sqlserver://localhost:1433;databaseName=test1
  first.datasource.username=admin
  first.datasource.password=admin
  first.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDeriver
   first.datasource.hikari.maximumlPoolSize=50
  # Second Datasource
  second.datasource.jdbcUrl=jdbc:postgresql://db-server-bar:5432/test2
  second.datasource.username=admin
  second.datasource.password=admin
  second.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDeriver
   second.datasource.hikari.maximumlPoolSize=50
  </code></pre>
  
  <p>FirstConfig.java</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @EnableJpaRepositories(
    entityManagerFactoryRef = "entityManagerFactory",
    basePackages = { "com.org.first.repo" }
  )
  public class FirstConfig {
  
    @Primary
    @Bean(name = "dataSource")
    @ConfigurationProperties(prefix = "first.datasource")
    public DataSource dataSource() {
      return DataSourceBuilder.create().build();
    }
  
    @Primary
    @Bean(name = "entityManagerFactory")
    public LocalContainerEntityManagerFactoryBean 
    entityManagerFactory(
      EntityManagerFactoryBuilder builder,
      @Qualifier("dataSource") DataSource dataSource
    ) {
      return builder
        .dataSource(dataSource)
        .packages("com.org.first.entity")
        .persistenceUnit("first")
        .build();
    }
  
    @Primary
    @Bean(name = "transactionManager")
    public PlatformTransactionManager transactionManager(
      @Qualifier("entityManagerFactory") EntityManagerFactory 
      entityManagerFactory
    ) {
      return new JpaTransactionManager(entityManagerFactory);
    }
  }
  </code></pre>
  
  <p>SecondConfig.java</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @EnableJpaRepositories(
    entityManagerFactoryRef = "barEntityManagerFactory",
    transactionManagerRef = "barTransactionManager",
    basePackages = { "com.org.second.repo" }
  )
  public class SecondConfig{
  
    @Bean(name = "barDataSource")
    @ConfigurationProperties(prefix = "second.datasource")
    public DataSource dataSource() {
      return DataSourceBuilder.create().build();
    }
  
    @Bean(name = "barEntityManagerFactory")
    public LocalContainerEntityManagerFactoryBean 
    barEntityManagerFactory(
      EntityManagerFactoryBuilder builder,
      @Qualifier("barDataSource") DataSource dataSource
    ) {
      return
        builder
          .dataSource(dataSource)
          .packages("com.org.second.entity")
          .persistenceUnit("second")
          .build();
    }
    @Bean(name = "barTransactionManager")
    public PlatformTransactionManager barTransactionManager(
      @Qualifier("barEntityManagerFactory") EntityManagerFactory
      barEntityManagerFactory
    ) {
      return new JpaTransactionManager(barEntityManagerFactory);
    }
  }
  </code></pre>
  
  <p>The configuration is not picking my maximum pool size that I set in the properties file. When I check in the data source object which is showing as 10. How do I override the default values set in the hikari datasource?</p>