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

Operating System version: windows 10

Java version: 1.8

现象：

在测试cluster: zone-aware时，ZoneAwareClusterInvoker类的doInvoke方法抛出了java.lang.ClassCastException，异常信息为：

java.lang.ClassCastException: org.apache.dubbo.registry.integration.RegistryDirectory$InvokerDelegate cannot be cast to org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker

at org.apache.dubbo.rpc.cluster.support.registry.ZoneAwareClusterInvoker.doInvoke(ZoneAwareClusterInvoker.java:63)

配置：

Provider#1

server:

port: 8090

dubbo:

scan:

base-packages: cn.service.test.api

application:

name: dubbo-service

config:

multiple: true

protocol:

name: dubbo

port: 2080

threads: 200

provider:

version: 1.0.0

registry:

check: false

timeout: 20000

use-as-config-center: false

address: zookeeper://localhost:2181

zone: zone-1

Provider#2

server:

port: 8091

dubbo:

scan:

base-packages: cn.service.test.api

application:

name: dubbo-service

config:

multiple: true

protocol:

name: dubbo

port: 2081

threads: 200

provider:

version: 1.0.0

registry:

check: false

timeout: 20000

use-as-config-center: false

address: nacos://nacos.ym:80

zone: zone-2

Consumer

server:

port: 8092

dubbo:

scan:

base-packages: cn.service.test.api

application:

name: dubbo-client

protocol:

name: dubbo

port: 2082

threads: 200

config:

multiple: true

provider:

version: 1.0.0

registries:

zone1:

address: zookeeper://localhost:2181

timeout: 20000

use-as-config-center: false

cluster: zone-aware

zone2:

address: nacos://nacos.ym:80

timeout: 20000

preferred: true

use-as-config-center: false

cluster: zone-aware

问题

目前dubbo的文档中未发现zone-aware的使用方式，请问是配置错误导致吗？

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

Operating System version: all

Java version: all

Steps to reproduce this issue

create two ReferenceConfig for same service with different configuration.

<dubbo:reference id="demoService" interface="com.alibaba.dubbo.DemoService">

</dubbo:reference>

<dubbo:reference id="demoServiceAsync" interface="com.alibaba.dubbo.DemoService" async="true">

</dubbo:reference>

startup the consumer application.

get the ConsumerModel from ApplicationModel.

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

Expected Result

ApplicationModel.allConsumerModels() should returns two ConsumerModel.

Actual Result

ApplicationModel.allConsumerModels() only returns the first ConsumerModel.

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

With future investigation, ReferenceConfig cannot put the second ConsumerModel as they are in same serviceName.

Also, this is the same issue for provider with below configuration.

<dubbo:service interface="com.alibaba.dubbo.DemoService" ref="demoService">

</dubbo:service>

<dubbo:service interface="com.alibaba.dubbo.DemoService" ref="demoService2">

</dubbo:service>

Here is my PR: #2582