【发布时间】:2020-08-09 18:54:39
【问题描述】:
我有一个用例,我需要从我的属性文件中检索值,但该键应该从我的查询参数中动态派生。
如何在 MEL 或 Groovy 中处理这个问题?我知道在 DW 中是可能的。
Http request
https://localhost:9898/getStore?search=customer.weststore.name
我的占位符是 -
file.properties
customer.weststore.name=TESTING
customer.eaststore.name=IRERRER
所以我需要访问这样的东西的方式
<set-variable variableName="westDetail" value="#[message.inboundProperites['customer.weststore.name']" doc:name="Variable"/>
<logger message="${westDetail}" level="INFO" /> --> Failed as no placeholder available
当我尝试上述方法时,由于没有可用的“westDetail”占位符而失败,而我需要从属性文件中获取该特定键。
这与本文有关 - https://help.mulesoft.com/s/question/0D52T00004mXTQUSA4/dynamically-read-property-values-from-a-properties-file-in-mule 但 DW 提供的唯一解决方案不是 MEL 或 Groovy。
有人怎么建议,有可能吗?
【问题讨论】:
标签: groovy mule mule-esb mule-el