【发布时间】:2021-02-16 18:36:17
【问题描述】:
有没有办法使用 property mediator 从 wso2 中的文件中读取属性?
我从 file.properties 注入地址 uri,并将文件路径作为 -Dproperties.file.path 参数传递给启动脚本,它只能使用地址端点的 uri 属性解析变量语法 $FILE:variableName 如下:
<call>
<endpoint>
<address uri="$FILE:uploadPath">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>1</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</address>
</endpoint>
</call>
但我也需要使用相同的属性,做一个小的转换并将它传递给一个类中介,
我已经尝试了以下方法,但它们都不起作用。
<log level="custom">
<property expression="$FILE:uploadPath" name="file-path-1"/>
<property expression="$ctx:uploadPath" name="file-path-2"/>
<property expression="$axis2:uploadPath" name="file-path-3"/>
<property expression="$trp:uploadPath" name="file-path-4"/>
<property expression="$axis2:POST_TO_URI" name="POST_TO_URI"/>
</log>
以下是我正在使用的操作系统和工具的版本。 操作系统:Mac os catalina, WSO2:微积分器 1.2.0,Integration sutdio - 7.1.0
【问题讨论】:
标签: wso2