Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不同 nacos 地址里面的同名服务提供者,使用泛化调用的时候,请求会发错地址 #9601

Open
amosnothing opened this issue Jan 20, 2022 · 1 comment

Comments

@amosnothing
Copy link

amosnothing commented Jan 20, 2022

背景:

  1. 两个注册中心
  2. 服务提供者:具有相同的方法和入参类型
  3. 使用泛化调用
  4. dubbo 版本:2.7.8 和 2.7.15 都试过

步骤:

  1. 先通过注册地址 address1 来调用该接口:此时数据正常打到 address1 的对应 ip 服务器
  2. 再通过注册地址 address2 来调用该接口:此时数据仍然打到 address1 的对应 ip 服务器
  3. 代码如下
// KEY_GENERATOR 是我自定义的,规则是:nacos://host:port/namespace/group/com.xxx.yyy.zzzService:1.0.0
final ReferenceConfigCache cache = ReferenceConfigCache.getCache(ReferenceConfigCache.DEFAULT_NAME,
                KEY_GENERATOR);
final GenericService genericService = cache.get(reference);
@amosnothing
Copy link
Author

amosnothing commented Jan 24, 2022

尝试过以下几个方式:均无效果

  1. 使用ReferenceConfigCache,从缓存获取,并且 key 是自定义的 nacos://host:port/namespace
  2. Registry的 address 使用 namingCacheRegistryDir ,不同的 nacos 地址使用不同的目录
  3. Registry的 file字段:不同的 nacos 地址对应不同的 .cache 文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants