Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.3 and 2.7.2

Operating System version: Windows 10

Java version: 1.8.0_151

Steps to reproduce this issue

pom:

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId></exclusion>
</exclusions>
<version>0.9.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.7.3</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>

create a configuration class, without any dubbo properties in local file.

@EnableDubbo(scanBasePackages = {"com.xxxx.rpc"})
@Configuration
public class DubboConfig {

@Bean
public ConfigCenterConfig configCenterConfig() {
ConfigCenterConfig configCenterConfig = new ConfigCenterConfig();
configCenterConfig.setAddress("apollo.xxxx.com");
configCenterConfig.setProtocol("apollo");
configCenterConfig.setNamespace("dubbo");
configCenterConfig.setGroup(null);
return configCenterConfig;
}
}

The RegistryAddress provided in Apollo namespace: dubbo:

property key: dubbo.properties

property value:

dubbo.application.name=Consumer
dubbo.application.qos-enable=false
dubbo.registry.address=zookeeper://zk.xxxxx.com?backup=zk2.xxxxx.com
dubbo.registry.simplified=true

as shown in picture:

http://dubbo.apache.org/img/apollo-configcenter-application.jpg

when add dubbo.registry.address=N/A to local properties file，the apollo config is truely resolved. but the problem exception still remain.

The consumer code:

@Reference(version = "${xxxx.service.version}", retries = 0, lazy=true)
private IRExecutionService executionService;

I will provide full code to reproduce this issue if it's necessary.

Expected Result

The document shows ConfigCenterConfig support RegistryConfig.

Actual Result

What actually happens?

the exception trace:

Caused by: java.lang.IllegalStateException: No such any registry to reference com.xxx.yyy.IRExecutionService on the consumer a.b.c.d use dubbo version 2.7.3, please config <dubbo:registry address="..." /> to your spring config.
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:390) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:329) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:250) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.init(ReferenceAnnotationBeanPostProcessor.java:269) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.access$100(ReferenceAnnotationBeanPostProcessor.java:242) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildInvocationHandler(ReferenceAnnotationBeanPostProcessor.java:236) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildProxy(ReferenceAnnotationBeanPostProcessor.java:219) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:134) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:360) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:540) ~[dubbo-2.7.3.jar:2.7.3]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:147) ~[dubbo-2.7.3.jar:2.7.3]

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.3

Operating System version: window

Java version: 1.8

Steps to reproduce this issue

配置文件配置

nacos.address = 192.168.1.199:8848

nacos.dataId = dubbo-EsMobileClientLauncher-cousumer

nacos.namespace = fd4c2b5d-3649-4558-b85f-50b2f0eb6c4a

dubbo.registry.address = nacos://192.168.1.199:8848?namespace=fd4c2b5d-3649-4558-b85f-50b2f0eb6c4a

启动时启用动态配置中心，服务发现

@SpringBootApplication

@configuration

//@EnableCaching

//@EnableSwagger2

@EnableDubbo(scanBasePackages = "com")

@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "${nacos.address}",namespace="${nacos.namespace}"))

@EnableNacosDiscovery(globalProperties = @NacosProperties(serverAddr = "${nacos.address}",namespace="${nacos.namespace}"))

@NacosPropertySource(dataId = "${nacos.dataId}",autoRefreshed=true)

public class EsMobileClientLauncherApplication

dubbo-admin控制台配置条件路由

conditions:

=> host != 192.168.0.206

enabled: true

force: true

key: com.everstar.mobile.service.INetEventService:1.0.0

priority: 0

runtime: true

scope: service

发现条件路由并没有生效

通过debug查看控制台

debug了一下，发现

使用的NacosRegistry

也订阅了routers

日志显示注册完consumers以后，也进行了订阅了，Categories包含了routers

查看源码，发现

org.apache.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(URL url, NotifyListener listener)

会循环Categories

org.apache.dubbo.registry.nacos.NacosRegistry.doSubscribe(URL url, NotifyListener listener, Set serviceNames)

里没有循环Categories

更改nacos里的provider服务状态，可以监听到变更，控制台有打印变更的日志

更改nacos里的routers状态，监听不到变更，控制台没有变更的通知

怀疑NacosRegistry.doSubscribe里没有循环Categories，导致没有订阅routers

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps？

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!