簡體   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