dubbo framework

2.1 dubbo  

  Apache Dubbo (incubating) | dʌbəʊ | is a high performance, lightweight open-source Java RPC framework that mention
for the three core capabilities: an interface for remote method invocation, intelligent fault tolerance and load balancing, and automatic registration and service

Find.

  Dubbo is a distributed service framework, providing high performance and RPC remote service call scheme transparent, serving
Affairs Governance program.
Official website: http: //dubbo.apache.org/zh-cn/

Quick Start Document address: http: //dubbo.apache.org/zh-cn/docs/user/quick-start.html

Oriented interface agent: call interface methods, the method A calls B server server by dubbo realize B's
call, we do not care about the details of implementation, as MyBatis visit Dao interface, you can operate the same database. Do not shut
implement interface methods hearts Dao. Such development is convenient and comfortable.

 

2.2 The basic architecture

Chart:

provider: provider, vendor, provider

consumer: the consumer

subscribe: Subscribe

notify: notification

invoke: calling, call

  Service Provider ((Provider)): exposed Services provider, service provider when you start, the registry injection
volume of services they provide.
  Service consumer ((Consumer): call the remote service consumer services, consumer services at startup, to register
a subscription service center they need, service consumers, providers from the address list, based on the soft load balancing algorithm, choose a
station call provider, if the call fails, then select another call.
  registration Center ((Registry)): returns the registry service provider address list to the consumer, if there is a change, the registration
center will be based on the long connection push change data to the consumer
  monitoring center ((monitor)): service consumers and providers, in memory of the cumulative number of calls and call time, time
sent once a minute statistical data to the monitoring center

 

Call relationship Description:
⚫ service container is responsible for starting, load, run service provider.
⚫ service provider when you start, registration services they provided to the registry.
⚫ service consumers at startup, you need to subscribe to the service registry.
⚫ Registry return address list service providers to consumers, if there is a change, the registry will be based on the long connection push
change data to consumers.
⚫ service consumers, providers from the list of addresses, soft load balancing algorithm, choose a provider invoked, as
if the call fails, then select another call.

⚫ service consumers and providers, in memory of the cumulative number of calls and call time, time sent once per minute statistical
data to the monitoring center.

 

2.3 dubbo Supported protocols

  Support multiple protocols: dubbo, hessian, rmi, http , webservice, thrift, memcached, redis.
dubbo official recommended dubbo agreement. Dubbo default port 20880 protocol
used Dubbo protocol, spring profile was added:
<Dubbo: Protocol name = "Dubbo" Port = "20880" />

 

2.5 Direct Connect dubbo

  Point of direct project: consumers direct access to the service provider, there is no registry. Consumers must specify the service
access provider's address (url).
Consumers direct access to the service provider through a fixed url address. The url address is unchanged.

 

2.5.1 goals

 

2.5.2 implementation

To JavaSE for example, service providers, service consumers are JavaSE project

(1) create Service Provider: Service Orders

A, built a new java project

Project Name: link-orderservice-provider
setting to version 1.0.0

B, maven pom.xml

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-context</artifactId>
  <version>4.3.16.RELEASE</version>
</dependency>
<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>dubbo</artifactId>
  <version>2.6.2</version>
</dependency>

 

在<build>中加入 plugin

 

Guess you like

Origin www.cnblogs.com/Tpf386/p/11101424.html