I have one yaml file that reads all the environment profiles. I need another yaml file to create a feature switch that i can turn on/off during deployment. And how can we define the feature switch in properties file.
Yes, you can use multiple YAML files if you use spring profile. For example, if you start your JVM with the following flag:
-Dspring.profiles.active=deployed,cassandra
It will pick up the following application YAML files:
application.yml
, application-deployed.yml
, and application-cassandra.yml
Another way to do this, is by adding this key in the application.yml file like below
spring:
profiles:
include:
- student
- address
and you can name your yaml files, as
application-student.yml, application-address.yml
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