wujimin commented on a change in pull request #1769:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1769#discussion_r428802019



##########
File path: 
service-registry/registry-zero-config/src/main/java/org/apache/servicecomb/zeroconfig/ZeroConfigRegistryApplicationListener.java
##########
@@ -52,24 +52,23 @@
   private static final Logger LOGGER = LoggerFactory
       .getLogger(ZeroConfigRegistryApplicationListener.class);
 
-  private ApplicationContext applicationContext;
   private MulticastSocket multicastSocket;
 
   @Override
   public void setApplicationContext(ApplicationContext applicationContext) 
throws BeansException {
 
     // same mechanism as Local registry to enable the Zero Config registry
-    String flag = 
System.getProperty(ZeroConfigRegistryConstants.ZERO_CONFIG_REGISTRY_FLAG);
-    if (flag != null && 
flag.equals(ZeroConfigRegistryConstants.ZERO_CONFIG_REGISTRY_ENABLE_FLAG)) {
-      this.applicationContext = applicationContext;
-      BeanUtils.setContext(applicationContext);
+    boolean enable = DynamicPropertyFactory.getInstance()
+        .getBooleanProperty("servicecomb.zeroconfig.enabled", false).get();
+
+    if (enable) {

Review comment:
       better to be: not enabled then return




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to