Dubbo Principle Analysis-Cluster & fault Tolerant directory Services

Source: Internet
Author: User

The cluster directory service directory, which represents multiple Invoker, can be viewed as LIST<INVOKER>, and its value may be dynamically changed such as registry push changes. Cluster selects all services through directory service when invoking service

Interface definitions for Directory

Public Interface Directory<t> extends Node {

// service type

Class<t>getinterface ();

// list the executable objects for all services

List<invoker<t>>list (invocation invocation) throws rpcexception;

}

There are two specific implementations of directory


Staticdirectory: Static directory service, all of its invoker passed through the constructor, the service consumer refers to the service, the service to the multi-Registry reference, the Invokers collection directly into the Staticdirectory constructor, And then disguised as a invoker by cluster.


The Staticdirectory list method returns all Invoker collections directly

Registrydirectory: Register directory service, its Invoker collection is obtained from the registry, it implements the Notifylistener interface implements the callback interface notify (list<url>).

For example, the consumer to invoke a remote service, the registry will be subscribed to all the service providers of the service, the subscription and service provider data changes when the consumer's Notifylistener service callback notify Method Notifylistener.notify (List <Url>) callback interface to the provider's URL address of all services and then convert the URLs to Invokers, which is the refer Application remote service


All invokers that are called to this remote service are available in the registrydirectory referencing a remote service at this time.

Registrydirectory.list (invocation) is the Invoker execution object that gets all the remote service references based on the service invocation method

Dubbo Principle Analysis-Cluster & fault Tolerant directory Services

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.