Roger Luo
Roger Luo

Reputation: 63

How to use "registry" scope in WSO2 ESB 4.9.0?

I want to have a try with the new "registry" scope in ESB 4.9.0, but when I set up a simple proxy with the provided example in property mediator documentation, it cannot be saved and reports an error.

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

Here is the proxy

<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>

I am not sure if I need to set up some configuration first? I downloaded a new esb 4.9.0 package, and run separately. Thanks in advance!

Upvotes: 2

Views: 930

Answers (2)

Yosley Soto
Yosley Soto

Reputation: 13

Version 4.9 does not allow this value for the scope of a property mediator.

Download the ESB 5.0.0 and you will see that your proxy works perfectly.

You can store in "registry" scope in this version.

 <?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>

Upvotes: 1

Philipp
Philipp

Reputation: 4749

You can retrieve properties from within the registry by using the registry scope.

<property name="fromRegistryToDefault" expression="get-property('registry','registryPath@propertyName')"/>

Documentation of retrieving properties from registry

But I don't think you can store new properties into the registry store directly from a Proxy inSequence. Do you have any documentation about that?

Upvotes: 1

Related Questions