Want to read gateway properties from config server - spring-boot

I have a spring cloud gateway in my project and I want to use config server with that.
What exactly I want to do is
enter image description here
I want to read these highlighted values from config server.
i kept these values in config server, still it reads the values from application property not from config,,,, Can som1 plz help here
when i use #value to read these values then it takes config server values...
Is it like config server only works with #value????

Related

Read property values from redis server, if redis connection is not available then read it from application.properties file

Spring, read all the property values on startup, but, I have to read all the property values from redis server instead of application.properties file.
If redis server connection is not available due to any reason, then the property values should be read from application.properties file.

Spring boot Redis cache TTL property change on the fly

is it possible to change the TTL property of Redis cache during the runtime if the same property has been changed in app config server? is there a way to automate the process to refresh the Redis instance properties during runtime on the event of config server change?
If you want to get the latest property in Config Server, it is recommended to do it through the client polling method, which can be found at
https://learn.microsoft.com/en-us/azure/spring-apps/how-to-config-server#config-server-refresh
Regarding the load to Redis instances, you may need to write some code to send out the event.

How can I choose bootstrap.yml according to db config?

I have two nacos bootstrap.yml which means two nacos with different ip, I want to load one of the bootstrap.yml according to db config.
For example, if my loadVariable value from db config is A, I want to load bootstrap-a.yml. How can I do that?
Here is my purpose step:
search data from db to decide load bootstrap-a.yml or bootstrap-b.yml
register the service to nacos according to bootstrap config file

How to refresh config clients automatically?

I am new to Spring Config Server/Client technologies.
I am using a spring config server to hold some config values.
Config clients will connect to the server and get the values.
If i change some of the config values at the config server, then currently I have to refresh the clients to load the config details from config server again by invoking "/refresh" on each client.
Is there anyway the clients will be notified by the config server and they will then reload the configuration again ?
Yes there is a way.
The solution is to use the Spring Cloud Bus. Using this module, you would link multiple clients to the server using a message broker. The only message broker implementation currently supported by this module is AMQP. Once the clients are connected to the server, invoking the endpoint on the server /bus/refresh will automatically broadcast the configuration changes to all the subscribed clients. This therefore means it is possible to reload configuration changes for any number of clients with one single refresh request which originates at the server.

Strange behavior with log4j2 configuration

I am working with spring cloud and log4j2 with "all" as level.
I will describe two situations with the same config file, I want to write on a Syslog TCP.
First test: I puth my log4j2 config file in resources folder, then, I start my app and start logging to the syslog.
But I need my configuration on a git, so I expose it to an url.
So here comes the second test:
I changed my bootstrap.yml and and the followind line:
logging: config:
http://xxx.xx.xx.75:3000/admin123/config-repository/raw/master/log4j2.xml
Then, I started my app and it starts to write the logging lines of spring boot in my syslog, but, when I put:
LOGGER.info("printing lalala");
Nothing is writed in the syslog and I can see a [FIN, ACK] beetween client and server on my TCP connections.
So, I understand that the config file is readed from the repository, becouse I can see it in my connections capture and becouse the app starts to log on syslog some lines, but something happend after that to close connection and write no more.
I can`t understand what is happening.
You must add the path of the logging.config on the application.yml not the bootstrap.yml and it works.

Resources