You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by GitBox <gi...@apache.org> on 2022/05/03 07:02:22 UTC

[GitHub] [synapse] n-jay commented on a diff in pull request #55: Add environment variable injection for SOAP and WSDL endpoints

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


##########
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 " +

Review Comment:
   Removed repeated lines and updated to log.debug in the new unified method declaration



-- 
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-unsubscribe@synapse.apache.org

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


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