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


##########
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:
   Remove the no. of variables and remove the else condition



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to