How to define Environment specific URL using system variables- WSO2 API Manager and ESB

Lets see to define Environment specific URL using system variables- WSO2 API Manager and ESB

Define your endpoint as follows.

<endpoint name="EP1" template="endPointTemplete"

  uri="http://{system.prop.env}.wso2.com" xmlns="http://ws.apache.org/ns/synapse"/>


it would refer to an endpoint template named as 'endPointTemplate'. The config for it is given below

<template name="endPointTemplete" xmlns="http://ws.apache.org/ns/synapse">

  <endpoint name="$name">
<address uri="$uri">
<suspendOnFailure>
<progressionFactor>1.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
</address>
</endpoint>
</template>


Proxy service will refer the EP1 endpoint.
Environment name would be set as a param at server startup
wso2server.sh -Denv=QA

No comments:

Post a Comment

Empowering the Future of API Management: Unveiling the Journey of WSO2 API Platform for Kubernetes (APK) Project and the Anticipated Alpha Release

  Introduction In the ever-evolving realm of API management, our journey embarked on the APK project eight months ago, and now, with great a...