I have multiple profiles defined in my Spring boot application, Typically for different scenarios.
At startup, I specify the profiles to be applied and they are activated.
At run-time, I am looking for a way to activate profiles, without restarting the app.
I know Spring cloud config provides a way to externalize configuration and reload with restarting the app using actuator /refresh endpoint.
I changed the property spring.profiles.active=profileName in externalized configuration maintained by Spring Cloud Config for the application, to a different profile value and then reloaded using /refresh endpoint. But, changes are not getting reflected. I used native profile of Spring cloud config.
But, I need to change the profile or add profiles after the app is started using Spring cloud Config/actuator or some other mechanism.
Is there a way to accomplish my requirement.