Search code examples
wso2

WSO2 ESB: Get Address Endpoint URI from registry


I want to define my URL in the registry so that I can change it between environments without having to redeploy CAR files. I have done this successfully in the past for HTTP Endpoints, but with Address Endpoints, I cannot get it to work.

How I normally would do it, is to declare the property in the API.xml file:

<property name="uri.var.my_EP" expression="get-property('registry', 'gov:/integration/endpoints/myapp/my_EP')" scope="default" type="STRING"/>

Then I simply replace the hard-coded URI with my property in the endpoint.xml file:

<http method="post" uri-template="{uri.var.my_EP}">

If I do the following on the Address Endpoint, I get a "The system cannot infer the transport information from the {uri.var.my_EP}" error:

<address uri="{uri.var.my_EP}">

What/how must I do to define the URI for Address Endpoints in the registry?


Solution

  • If you have properly stored in registry, you can use endpoint directly like below:

    <endpoint key="gov:/integration/endpoints/myapp/my_EP"/>

    Personally, for endpoints i use conf:/.. repository.