laywin commented on code in PR #14874:
URL: https://github.com/apache/dubbo/pull/14874#discussion_r1859759730


##########
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java:
##########
@@ -782,14 +782,17 @@ public void prepareApplicationInstance(ModuleModel 
moduleModel) {
         // export MetricsService
         exportMetricsService();
 
-        if (moduleModel.getDeployer().hasRegistryInteraction()) {
+        boolean registryConfiged = CollectionUtils.isNotEmpty(
+                
moduleModel.getApplicationModel().getApplicationConfigManager().getRegistries());
+
+        if (registryConfiged) {

Review Comment:
   > Comparing to `hasRegistryInteraction()`, the new condition missed to check 
the registry configuration that is restricted in ServiceConfig. So this change 
might fix the registration issue for users programmatically using API but 
probably will cause new issue for users exporting services the other way.
   
   i think it should to start the registry schedule if there is a registry 
config in application config. because service export may happens after dubbo 
started, so the instance can't be registry. 



-- 
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