繁体   English   中英

如何在 Mule 4 中的 java class 中获取特定于环境的 yaml 文件

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

嗨,我的 Mule 应用程序中有特定于环境的 yaml 文件。 我需要在我的 Java Class 中阅读这些文件。 我的 Yaml 文件名将形成为

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

因此,对于每个环境,它都会加载特定的文件。 我需要在我的 java class 中获取相应的 env 文件。 我怎么能做到这一点。 我在 Java Class 中尝试了下面的方法,但它以 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想。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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