elvislou opened a new issue #9673:
URL: https://github.com/apache/dubbo/issues/9673


   我们正在做dubbo服务的跨机房双活
   
   假设有机房A和机房B,分别部署了nacos注册中心,我们叫nacosA和nacosB
   
   现在在机房A部署一个dubbo服务,注册到nacosA
   在机房B部署同一个dubbo服务,注册到nacosB
   
   现在想要做到的效果是:部署在机房A的消费者,需要优先调用机房A的dubbo服务,只有当机房A没有服务的时候,
   再调用机房B的服务
   
   根据网上资料和dubbo源码,我们是通过调用前设置
   RpcContext.getContext().setAttachment("registry_zone", "A");
   来实现的(配置文件声明registry的时候,nacosA指定了zone参数为“A”,nacosB指定了zone参数为“B”)。
   
   
   但结果是,不起作用,有时候会调用机房A的服务,有时候会调用到机房B的服务,
   
   dubbo版本是2.7.14
   
   demo见附件
   
[dubbo_zone_demo.zip](https://github.com/apache/dubbo/files/8040826/dubbo_zone_demo.zip)
   。


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