spring-cloud-config client not getting refreshed on property change - spring

How can I get my spring-boot application (client) to refresh it's properties - which are coming from spring-cloud-config stand alone Server? I've annotated #RefreshScope, added config in bootstrap.yml for spring.cloud.config.uri and spring.application.name I can see server is able to get the config using it's HTTP end-pt and also Client gets the config using spring-boot /manage/env end-pt. It's just that if I commit a property change to git, it is not changing in my Client App.

Related

Update keycloak from config file

I am using keycloak embedded into spring application explained in this tutorial https://www.baeldung.com/keycloak-embedded-in-spring-boot-app
There is a configuration file for keycloak that is contained within that application, but the configuration is imported into keycloak and into database only the first time that application is started.
Is there a way to make updates on that config file reflect on the state of the keycloak?
Developers should be able to change configurations and push changes to version control. When somebody pulls the new configuration it should reflect on his local instance of keycloak.

Load properties from application.properties in Spring Cloud Config until refreshed

I've a setup with Spring Cloud Config Server and Client as described in the response here. The next thing I'm trying to do is load the properties from application.properties in the client when the service starts. Once I call /actuator/refresh I would like to load it from the Config Server. Is this even possible? Thanks!

Avoid resetting HikariCP datasource connection pool on property change/refresh

I am using spring boot 2 with PCF config server to use centrallized config. My microservice is basic crud rest service. What I noticed is that whenever a property is being changed and http post is being made on "actuator/refresh" endpoint, spring boot 2 drops all connection including active ones and rebuilds the connection pool. How can I avoid this? I am also using spring-boot-starter amqp and cloud bus to notify all my service instance to refresh the properties so it is also happening for http post on "actuator/bus-refresh".
Also to clarify, I didnot change any property related to datasource config, instead I am changing application specific property, so why does spring boot refreshing datasource, I did not understood.

spring cloud config client set config url at property file

I have a spring cloud project. There are config server (config-srv), eureka server (eureka-srv) and some other service with business logic, let's call it main service (main-srv).
I'm packaging them into jars and run one by one. My apps get their properties from a file in the same directory with jars.
So, I'm setting properties to config-srv through "application-native.properties".
But if i want to change config-srv url (for example, i want http://localhost:9999), how can i share this url for all micro-services before they will boot ? I'm trying to share this url in "application-default.properties" but it makes no effect.
You can put the Spring Cloud Config server details in bootstrap.properties file in each microservices.
spring.application.name=microserviceName
spring.profiles.active=dev
spring.cloud.config.uri=http://localhost:9999
spring.cloud.config.username=your_username
spring.cloud.config.password=your_password
Go through the link to have more detail about spring cloud config
https://howtodoinjava.com/spring-cloud/spring-cloud-config-server-git/

Using Spring cloud config in multi application architecture

I am currently using Spring external configuration by creating a config server, config client and a Git repository with property files. Is there any way to use this config server for multiple applications?
My Current Architecture:
Created a Git repository with config files.
Created a Config Server which connects to the above Git repository for property files.
Created a Client (Spring boot application) which connects to the config server to load the properties.
When there is a change in any of the property files, I am invoking the refresh method of config client to refresh the properties. If there are multiple applications using the same config server and git repository for property files, what should be the approach to refresh all the properties without invoking the /refresh method of all the applications?
I tried /refresh of the config server but it doesn't refresh the properties as they are loaded during the application startup.

Resources