Skip to content

ZoneAwareClusterInvoker ClassCastException  #6320

@z-z-liu

Description

@z-z-liu
  • 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的使用方式,请问是配置错误导致吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions