如何从 wso2 esb 中的属性文件中读取数据
How to read data from properties file in wso2 esb
我在 //wso2esb-4.9.0/repository/conf
文件夹中创建了一个文件 test.properties
。
在这个 test.properties
文件中,我根据下面给出的属性创建了文件
testData=welcome
现在,我想在 WSO2 的代理文件中读取 testData
值。
这里是获取值的代理代码:
<property name="irisprop" expression="get-property('registry','conf:/iris.properties@tokenvalue')" scope="default"/>
get-属性('registry','') 将获取存储在注册表 1. You can refer to the documentation on 2 中的值,[3] 以进一步说明注册表。您可以使用 carbon 控制台浏览和添加注册表资源。
您将无法使用 属性 中介器直接读取文件内容。但是如果您的用例是使用文件系统来存储数据,您将需要使用 VFS 传输或文件连接器。请参阅文档 [4]、[5] 以进一步阐明这一点。
1-https://docs.wso2.com/display/EI6xx/Property+Mediator#PropertyMediator-Example4:ReadingafilestoredintheRegistry
2-https://docs.wso2.com/display/ESB490/Working+with+the+Registry
[3]-https://docs.wso2.com/display/ESB490/Managing+Registry+Content
[4]-https://docs.wso2.com/display/EI6xx/VFS+Transport
[5]-https://docs.wso2.com/display/ESBCONNECTORS/File+Connector
我在 //wso2esb-4.9.0/repository/conf
文件夹中创建了一个文件 test.properties
。
在这个 test.properties
文件中,我根据下面给出的属性创建了文件
testData=welcome
现在,我想在 WSO2 的代理文件中读取 testData
值。
这里是获取值的代理代码:
<property name="irisprop" expression="get-property('registry','conf:/iris.properties@tokenvalue')" scope="default"/>
get-属性('registry','') 将获取存储在注册表 1. You can refer to the documentation on 2 中的值,[3] 以进一步说明注册表。您可以使用 carbon 控制台浏览和添加注册表资源。
1-https://docs.wso2.com/display/EI6xx/Property+Mediator#PropertyMediator-Example4:ReadingafilestoredintheRegistry
2-https://docs.wso2.com/display/ESB490/Working+with+the+Registry
[3]-https://docs.wso2.com/display/ESB490/Managing+Registry+Content
[4]-https://docs.wso2.com/display/EI6xx/VFS+Transport
[5]-https://docs.wso2.com/display/ESBCONNECTORS/File+Connector