wso2esb - WSO2 ESB Collout address from Property or XPath-expression -


I have configured with development and production segments. This section contains the backend URLs in my inequality Request multiple times on call request is required.

  & lt; config & gt; & Lt; env & gt; Prod & lt; / env & gt; & Lt; Backend env = "prod" & gt; http: // localhost: 1234 / & lt; / backend & gt; & Lt; Backend env = "dev" & gt; http: // localhost: 2345 / & lt; / backend & gt; & Lt; / Config & gt;   

I read this configuration as a local entry (XML) and want to set the callout URL as the property. I do not want to hardcode this backend inside my code with the "switch" statement because it is possible to use more than two environments. Can I show you an example?

Thank you.

You can read the xml file in the registry just define the property of OM type like this:

  & lt; Property name = "test" expression = "get-property ('registry', 'conf: /test.xml')" scope = "default" type = "om" />   

Then you can see values ​​by logging in this way:

  & lt; log level = "custom" & gt; & Lt; Property Name = "test.b" expression = "$ ctx: test // b" /> & Lt; / Logs & gt;   

And in the XML file that you have inserted into the root of the registry, you have to fill it out:

  & lt; A & gt; Hello & lt; B & gt; WSO2 & lt; / P & gt; & Lt; / A & gt;   

I have learned it from this.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -