risdenk commented on a change in pull request #242: KNOX-2190 - Processing 
advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242#discussion_r369648749
 
 

 ##########
 File path: 
gateway-cm-integration/src/main/java/org/apache/knox/gateway/topology/discovery/advanced/AdvancedServiceDiscoveryConfig.java
 ##########
 @@ -46,16 +46,17 @@ public AdvancedServiceDiscoveryConfig(Properties 
properties) {
   }
 
   public boolean isServiceEnabled(String serviceName) {
-    return 
Boolean.valueOf(getPropertyIgnoreCase(PARAMETER_NAME_PREFIX_ENABLED_SERVICE + 
serviceName, "true"));
+    final String propertyName = PARAMETER_NAME_PREFIX_ENABLED_SERVICE + 
getTopologyName() + PARAMETER_NAME_POSTFIX_ENABLED_SERVICE + serviceName;
+    return Boolean.valueOf(getPropertyIgnoreCase(propertyName, "true"));
   }
 
   public Set<String> getEnabledServiceNames() {
     return properties.entrySet().stream().filter(keyValuePair -> 
Boolean.valueOf((String) keyValuePair.getValue()))
-        .map(keyValuePair -> ((String) 
keyValuePair.getKey()).substring(PARAMETER_NAME_PREFIX_ENABLED_SERVICE.length()).toUpperCase(Locale.getDefault())).collect(toSet());
+        .map(keyValuePair -> ((String) 
keyValuePair.getKey()).substring(((String) 
keyValuePair.getKey()).lastIndexOf(".") + 
1).toUpperCase(Locale.getDefault())).collect(toSet());
 
 Review comment:
   I think you can use a character here `'.'` instead, but no big deal.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to