我想试试新的"注册表" ESB 4.9.0中的范围,但是当我在属性介体文档中使用提供的示例设置一个简单代理时,它无法保存并报告错误。
TID: [-1234] [] [2015-09-24 15:30:21,085] ERROR {org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin} - Unable to save changes made for the proxy service : test_property. Restored the existing proxy... :: Only 'axis2' or 'transport' or 'axis2-client' or 'default' or 'operation' values are allowed for attribute scope for a property mediator, Unsupported scope registry {org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin}
org.apache.synapse.SynapseException: Only 'axis2' or 'transport' or 'axis2-client' or 'default' or 'operation' values are allowed for attribute scope for a property mediator, Unsupported scope registry
这是代理
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="test_property"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="conf:/Resource/foo" value="Sample Property Content" scope="registry"/>
<respond/>
</inSequence>
</target>
<description/>
</proxy>
我不确定是否需要先设置一些配置?我下载了一个新的esb 4.9.0软件包,并单独运行。提前谢谢!
答案 0 :(得分:1)
您可以使用注册表范围从注册表中检索属性。
<property name="fromRegistryToDefault" expression="get-property('registry','registryPath@propertyName')"/>
Documentation of retrieving properties from registry
但我不认为您可以直接从Proxy inSequence将新属性存储到注册表存储中。你有关于那个的任何文件吗?
答案 1 :(得分:1)
版本4.9不允许使用属性介体范围的此值。
下载ESB 5.0.0,您将看到您的代理完美运行。
您可以在此版本的“注册表”范围内存储。
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="test_property"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property name="conf:/Resource/foo"
scope="registry"
type="STRING"
value="Sample Property Content"/>
<log level="full"/>
<respond/>
</inSequence>
</target>
<description/>
</proxy>