I am new to spring and creating a spring cloud config service. I have successfully created the configuration service where all the configurations are there. In my client service(this will fetch all the necessary configurations from the configuration service) I need to fetch the configurations depending on the SPRING_PROFILES_ACTIVE value which is defined in the manifest file. There are multiple manifest files in the client service and each has its own SPRING_PROFILES_ACTIVE value.
Currently I am using @ConfigurationProperties(prefix="profile_name") i.e manually defining the "profile_name". But, I want to make it dynamically i.e depending on the value of SPRING_PROFILES_ACTIVE the value should be fetched from configuration service.
Can anyone please suggest me how to load the value dynamically.
Thanks in advance.