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

Can Dubbo support aggregation when subscribe service from more than one Registry Server ? for example, ZK and Redis. #3084

Closed
flystar32 opened this issue Dec 27, 2018 · 5 comments
Milestone

Comments

@flystar32
Copy link

Environment

  • Dubbo version: 2.6.2
  • Operating System version: Mac OS
  • Java version: java8

Steps to reproduce this issue

  1. start a provider A which registry to zookeeper
  2. start an other provider B which provide the same service(interface) and registry to Redis
  3. start a consumer which subscribe service from both zookeeper and Redis
  4. consumer can only consume the provider A which registered to zookeeper.
  5. shut down the provider A, and then consumer can consume provider B.

Expected Result

in step 4, consumer can consume both provider A and provider B.

so, can Dubbo support aggregation when subscribe service from more than one Registry Server ?

In addition, how to assign the subscribe priority of two Registry Servers?

@carryxyh
Copy link
Member

I personally think that the use of this method is very limited.
If you have special needs, it is recommended to implement your own registration center.

@flystar32
Copy link
Author

A project has many applications, and they communication each other via dubbo RPC.
Anyone who want to migration this project's dubbo registration center smoothy will need this feature.
For example, migration registration center from redis to zookeeper without stop the full Project.

@carryxyh
Copy link
Member

I think u can impl a new Registry which will subscribe and registry to multi registration center.

@flystar32
Copy link
Author

@chickenlj @mercyblitz @ralf0131 Any suggestions for this issue ?

@zonghaishang
Copy link
Member

zonghaishang commented Dec 30, 2018

@flystar32

  1. dubbo支持多注册,多消费
    可以将你们的Provider为每个注册中心都注册一份数据,消费方消费多个注册中心服务,目前dubbo是按照配置注册中心的循序进行消费,比如是配置了redis, zk注册中心,优先消费redis服务,如果redis没有服务会自动去消费zk服务

  2. 这个和注册中心实现没有关系, 有2中方法可以支持你的需求:
    a. org.apache.dubbo.config.ReferenceConfig#createProxy
    AvailableCluster 默认是根据配置顺序消费注册中心数据,可以实现新的Cluster决定消费策略
    b. 你可以实现一个路由Router,多个注册中心在运行时动态决定消费哪个注册中心服务

Google translation:

Dubbo supports multiple registrations, more consumption
You can register your Provider for each registration center, and the consumer consumes multiple registration center services. Currently, dubbo is consumed according to the configuration registration center. For example, redis, zk registration center, priority consumption redis Service, if redis no service will automatically consume zk service

This has nothing to do with the registry implementation. There are 2 ways to support your needs:
a. org.apache.dubbo.config.ReferenceConfig#createProxy
AvailableCluster defaults to consuming registry data sequentially according to configuration
b. You can implement a routing router, and multiple registries dynamically determine which registrar service to consume at runtime.

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

5 participants