【问题标题】:Reading a properties config file which is in JSON format in Mule 4在 Mule 4 中读取 JSON 格式的属性配置文件
【发布时间】:2020-06-16 20:09:07
【问题描述】:

我正在 JSON 中创建一个配置属性文件。但我无法在流程中阅读它。 如何在 Mule 4 中读取 JSON 属性文件。

示例属性文件-config.json:

{
    "currency" : {"USA": "Dollar","India":"Rupee"},
    "table" : {"accountID": "Account"}
}

如果它是一个 .yaml 文件,我们使用 ${} 表达式来访问。但是如何在流程中访问 .json 属性文件呢?

提前致谢

【问题讨论】:

    标签: json mule dataweave mulesoft


    【解决方案1】:

    Mule 4 不支持 JSON 属性文件。它支持 .属性或 YAML: https://docs.mulesoft.com/mule-runtime/4.3/configuring-properties#supported_files

    您可以创建自己的自定义属性阅读器,支持 Java 中的 JSON:https://docs.mulesoft.com/mule-runtime/4.3/configuring-properties#custom-properties-provider

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-09
      • 1970-01-01
      • 2019-11-03
      • 1970-01-01
      相关资源
      最近更新 更多