Loading a registry entry into a wso2 property mediator

女生的网名这么多〃 提交于 2019-12-10 10:40:08

问题


I am currently loading data from a local entry in the wso2 esb using the following satement:

<property name="MAPPING" expression="get-property('mapping_id_ep_v1')" />

It loads the following local entry with the name mapping_id_ep_v1:

<mappings>
    <mapping id="ep_1">http://localhost:8280/services/ep_1</mapping>
    <mapping id="ep_2">http://localhost:8280/services/ep_2</mapping>
    <mapping id="ep_3">http://localhost:8280/services/ep_3</mapping>
<mappings>

I would like to load the data from a registry entry. I thought the following would work:

However, it throws an exception:

Evaluation of the XPath expression conf:/custom/inspectieview/routing.xml') resulted in an error {org.apache.synapse.util.xpath.SynapseXPath}
org.jaxen.UnresolvableException: Cannot resolve namespace prefix 'conf'

Anyone know if it is possible to load a value from the registry into a property mediator?

Regards, nidkil


回答1:


I solved my question. For anyone interested in the solution it is actually very simple. The following code loads a resource stored in the registry into a property that can be referenced in a mediator /sequence / etc.

<property name="MAPPING" expression="get-property('gov:/custom/service/resource')" />

Regards, nidkil




回答2:


You can achieve your requirement using the below configuration.

 <property name="testProp" expression="get-property('registry', 'gov://custom/testEntry')" scope="default" type="STRING"/> 



回答3:


Look at this

http://wso2.org/project/esb/java/4.0.3/docs/samples/message_mediation_samples.html

Sample 8 and following will help you



来源:https://stackoverflow.com/questions/11210545/loading-a-registry-entry-into-a-wso2-property-mediator

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!