n-jay commented on code in PR #55:
URL: https://github.com/apache/synapse/pull/55#discussion_r863519717


##########
modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/AddressEndpointFactory.java:
##########
@@ -115,7 +119,16 @@ public EndpointDefinition 
createEndpointDefinition(OMElement elem) {
         }
 
         if (address != null) {
-            endpointDefinition.setAddress(address.getAttributeValue().trim());
+            String extractedAddress = address.getAttributeValue().trim();
+            if (extractedAddress.contains(SYSTEM_VARIABLE_PREFIX)) {
+                String extractedEnvVariableKey = 
extractedAddress.substring(extractedAddress.lastIndexOf(":") + 1);
+                String extractedEnvVariableValue = 
System.getenv(extractedEnvVariableKey);
+                log.info ("Environment variable " + extractedEnvVariableKey + 
" replaced with " +
+                        extractedEnvVariableValue);
+                endpointDefinition.setAddress(extractedEnvVariableValue);
+            } else {
+                endpointDefinition.setAddress(extractedAddress);

Review Comment:
   commit: 
https://github.com/apache/synapse/pull/55/commits/8e51818d398bf9316873db0704ac359ca68e7b05



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
For additional commands, e-mail: dev-h...@synapse.apache.org

Reply via email to