spring-cloud-config

@RefreshScope and /refresh not working

微笑、不失礼 提交于 2019-11-30 15:55:20
问题 I have tried to implement spring external configurations using Config Server. It is working fine for the very first time when the application is started but any changes to the properties file are not being reflected. I tried to use /refresh endpoint to refresh my properties on the fly but it doesn't seem to be working. Any help on this would be greatly helpful. I tried POSTing to localhost:8080/refresh but getting a 404 Error response. Below is the code of my application class

How do you properly set different Spring profiles in bootstrap file (for Spring Boot to target different Cloud Config Servers)?

天涯浪子 提交于 2019-11-30 08:46:38
We have different config servers per environment. Each spring boot application should target its corresponding config server. I have tried to achieve this by setting profiles in the bootstrap.properties file, e.g.: spring.application.name=app-name spring.cloud.config.uri=http://default-config-server.com --- spring.profiles=dev spring.cloud.config.uri=http://dev-config-server.com --- spring.profiles=stage spring.cloud.config.uri=http://stage-config-server.com --- spring.profiles=prod spring.cloud.config.uri=http://prod-config-server.com And then I set the cla -Dspring.profiles.active=dev but

actuator /refresh is not being provided in SpringBoot 2.0.1

被刻印的时光 ゝ 提交于 2019-11-30 07:16:11
问题 I am creating a demo project for Spring-Config-Server and Spring-Config-Client . In SpringBoot 1.5.6.RELEASE everything is working fine. However, when I am upgrading project to 2.0.1.RELEASE it does not provide the actuator endpoints. Actuator endpoint provided in 1.5.6.RELEASE Mapped "{[/refresh || /refresh.json],methods=[POST]}" Mapped "{[/dump || /dump.json],methods=[GET] Mapped "{[/heapdump || /heapdump.json],methods=[GET] Mapped "{[/autoconfig || /autoconfig.json],methods=[GET] Mapped "{

How spring cloud config use local property override remote property

本小妞迷上赌 提交于 2019-11-29 14:11:49
问题 I know should set following properties, but still confused about where they should be set. spring: cloud: config: allowOverride: true failFast: true overrideNone: false application.properties file on spring cloud server side or client side or remote git repository? I set them in application.yml on server side, but don't work. I try set in application.yml on remote git, and again not work, hope you could give me some help, thanks. 回答1: I set the following configurations in remote git repo. It

Properties versioning with Spring Cloud Config

余生颓废 提交于 2019-11-29 03:26:20
问题 I am probably missing something here, but what is a good solution for properties versioning? For example, in a blue-green deployment scenario with property value changes (old app version consumes the old value, new version requires the new value), how do you ensure both versions of your app can successfully co-exist (considering potential restarts and rollbacks)? One option would be to create new property names for the properties that need new values applied. This, of course, is not a good

actuator /refresh is not being provided in SpringBoot 2.0.1

放肆的年华 提交于 2019-11-29 02:34:56
I am creating a demo project for Spring-Config-Server and Spring-Config-Client . In SpringBoot 1.5.6.RELEASE everything is working fine. However, when I am upgrading project to 2.0.1.RELEASE it does not provide the actuator endpoints. Actuator endpoint provided in 1.5.6.RELEASE Mapped "{[/refresh || /refresh.json],methods=[POST]}" Mapped "{[/dump || /dump.json],methods=[GET] Mapped "{[/heapdump || /heapdump.json],methods=[GET] Mapped "{[/autoconfig || /autoconfig.json],methods=[GET] Mapped "{[/resume || /resume.json],methods=[POST]}" Mapped "{[/configprops || /configprops.json],methods=[GET]

@RefreshScope not working - Spring Boot

家住魔仙堡 提交于 2019-11-29 01:15:55
问题 I am following the approach described here: https://github.com/jeroenbellen/blog-manage-and-reload-spring-properties, the only difference is that in my case, the properties are being used in multiple classes so I have put them all in one utility class CloudConfig and I refer to its variables using the getters. This is what the class looks like: @Configuration @RefreshScope public class CloudConfig { static volatile int count; // 20 sec @Value("${config.count}") public void setCount(int count)