I have externalized all my application needed property files from webapps in tomcat. Now i can simply change a property file value without a need of rebuilding the war file and deploy it again. However each change to property file is associated with server recyling.
Is there a way how the recycling can be avoided for a property file change. I am using spring to read the property files for few webapps and java property traditional way for few webapps.
Please suggest how to acheive
Regardless, there's no way to change the server.properties without restarting the server currently, you honestly should not have to change it that often. Instead, take precautions, broadcast to your users "We're making a configuration change, we'll be restarting in 10 seconds", It's not that difficult.
In spring boot application we can reload source code changes without restarting server.When we develop java application if we do any changes in source code then developer need to application restart and for application up. But in spring boot project we can reload changes in source code without restarting server.
Create a spring boot project and create an endpoint which will read a property from the application.properties file and will return the value in the application.properties file. We will change the value in the application.properties file and we will expect the new value without restarting the server.
All of these settings can be modified without restarting the SQL Server service, but some may require you to run RECONFIGURE WITH OVERRIDE to override the running value with the configured value. Configuration options requiring a restart of the SQL Server service are related to database locations and persisted trace flags:
You may want to consider spring-cloud-config-server or spring-cloud-consul all of these options supports distributed properties management as well as value changes refresh without a need to recycle app servers.
And you can use @RefreshScope
for Spring @Beans
that want to be reinitialized when configuration changes, they also provide the following Management endpoints out of the box and many more as explained on the project git page
/refresh
for refreshing the @RefreshScope
beans/restart
for restarting the Spring context (disabled by default)This is supported by either option (spring-cloud-config-server or spring-cloud-consul)
You may also give cfg4j a try. It supports reloading configuration from local files as well as remote services (git repository, Consul, etc.).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With