简体   繁体   中英

How to get Env specific yaml file inside java class in Mule 4

Hi I Have enviornment specific yaml files in my Mule Application. I need to read these file in my Java Class. My Yaml File name will be formed as

properties/${mule.env}/config-${mule.env}.yaml

So for each env it will load speicfic file. I need to get the respective env file in my java class. How i can do that. I tried like below in Java Class but its coming as null

@Value("${rixml.VersionID}")
private String version;

You can form the YAML filepath in your mule flow and then pass it as an argument to your java class.In your java class you can read the YAML file(from the file path passed to it), parse it and extract the value that you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM