title: @Refreshscope with Datasource configuration
body: <p>I am having a datasource configuration class in a Spring boot app. Snippet below</p>
  
  <p>My configuration is fetched from Spring cloud config server. When I change my DB hostname and refresh using /refresh endpoint, the app is NOT using new DB host. ANy idea why ?</p>
  
  <pre><code>@Configuration
  @RefreshScope
  public classe DBConfig
  {
    @Resource
      private Environment env;
  
     private DataSource ehubDataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
          dataSource.setDriverClassName(env.getProperty("datasource.driverClassName"));
          dataSource
                  .setUrl(env.getProperty("datasource.url"));
          dataSource.setUsername(env.getProperty("datasource.username"));
          dataSource.setPassword(env.getProperty("datasource.password"));
          return dataSource;
      }
  
  }
  </code></pre>