Hi, I recently upgraded centralized spring cloud config server management service from Spring Boot 1.5.3.RELEASE to Spring Boot 2.1.6.RELEASE and Spring cloud dependencies from Dalston.SR1 to Greenwich.SR2. Dynamically loading the new repo information to the environment (ConfigurableEnvironment) is not refreshing repos loaded at boot time in class MultipleJGitEnvironmentRepository -> repos. This feature was working fine with 1.5.3.RELEASE but failed in 2.1.6.RELEASE and Greenwich.RELEASE or Greenwich.SR2. Endpoint /actuator/refresh is not refreshing the updated "defaultProperties" in MultipleJGitEnvironmentRepository -> repos. Endpoint /actuator/env" is showing the updated environment "defaultProperties".

Comment From: spencergibb

I'm afraid I don't follow. Can you explain in more detail where you are calling actuator on config server or client?

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

Comment From: sguntaka

Hi Spencer, Endpoint "/actuator/refresh" is invoking from the config server code for refreshing the environment beans.

Here are the steps - 1. We have a scheduler method which invokes a common method getProperties() (load initial spring cloud configuration from couchDB at boot initialization) in an interval and refresh the environment properties, if any new properties found. After properties load to the environment invokes endpoint "/actuator/refresh" for beans to reinitialize. 2. The above solution was working with Spring Boot 1.5.x.RELEASE and Spring Cloud Dalston.SR1. MultipleJGitEnvironmentRepository -> repos are getting updated with the refreshed properties where as after upgrade to Spring Boot 2.1.6.RELEASE and Greenwich.SR2/RELEASE MultipleJGitEnvironmentRepository -> repos bean is not reinitialize with updated properties. Please see the attached code snippets for your reference. I am creating a sample project and publish to github in couple of days.

bootstrap.yml.pdf ConfigServerApplication.pdf Monitoring.pdf pom_sample.pdf

Please let me know if you need any information. Thank you.

Thanks, Siva

Comment From: spencergibb

We'll wait for the sample, though it sounds like you're doing something custom that may be out of the ordinary.

Comment From: sguntaka

Sure, I'll provide you the sample. Just curious are there any changes to "/actuator/refresh" 2.1.x with Spring Cloud 2.0.x/2.1.x properties bean reinitialization? This is built-in feature which was working with older version of Spring Boot and Spring Cloud. Please point if I am missing anything with 2.1.x configuration or implementation?

Comment From: sguntaka

I just found while debugging. Endpoint "actuator/refresh" is refreshing updated "spring.cloud.config.server.git" properties are loaded. MultipleJGitEnvironmentProperties -> public void setRepos(Map repos) { this.repos = repos; } Where as these repos are not reflecting in MultipleJGitEnvironmentRepository -> public void setRepos(Map repos) { this.repos.putAll(repos); } I see values was stored at boot time and not refreshing MultipleJGitEnvironmentRepository through "actuator/refresh" endpoint. Please see the screen shots. Screen Shot 2019-08-19 at 4 13 32 PM Screen Shot 2019-08-19 at 4 15 52 PM

Comment From: ryanjbaxter

We need a sample please

Comment From: sguntaka

Here is the sample repo - https://github.com/sguntaka/configserver-sample-Boot2.1.6.RELEASE-with-Greenwich.SR2.git

Comment From: ryanjbaxter

You are doing a lot of not so common things in this sample.

Can you confirm that this use case works if you are not reading and providing a custom properties file in just a plain spring cloud config server app?

Comment From: sguntaka

Yes, the app works fine with config server configuration properties read from application.yml or from the external source (couchDB). Solution was working fine with Spring 1.5.x version. Not sure what changes are causing this issue in latest version, the below classes are not getting updated environment properties after refresh. MultipleJGitEnvironmentProperties -> public void setRepos(Map repos) { this.repos = repos; } MultipleJGitEnvironmentRepository -> public void setRepos(Map repos) { this.repos.putAll(repos); } My use case is simple - Load spring cloud config server configuration from external source (couchDB) at boot time. - Scheduler method - Dynamically load the updated configuration from couchDB and set the updated properties to environment (defaultProperties). And invokes an endpoint "/actuator/refresh" for reinitializing the config server beans. Actuator endpoint "env" is showing the updated properties but these properties is not being refreshed in config server beans.

Comment From: spencergibb

Closing this due to inactivity. Please re-open if there's more to discuss.