Position: Home page » Computing » Is Dubbo decentralized

Is Dubbo decentralized

Publish: 2021-04-18 02:35:38
1. AEP mining, the unique mining mechanism of eco protocol, is an energy-saving, environment-friendly and ecological mining machine.
2. Yes, it's not too late. I suggest you go to the okex exchange to register. This is a domestic first-line platform, and its security is very guaranteed. If you are satisfied with my answer, please accept it
3.

BBO principle and mechanism: applications can realize the output and input functions of services through high-performance RPC, and can integrate seamlessly with spring framework

the registry is responsible for the registration and search of service address, which is equivalent to directory service. Service providers and consumers only interact with the registry at startup, and the registry does not forward requests, so the pressure is less

the monitoring center is responsible for the statistics of the times and time of each service call. The statistics are first summarized in the memory and then sent to the monitoring center server once a minute, and displayed in a report

the service provider registers its services with the registry and reports the call time to the monitoring center, which does not include the network overhead

the service consumer obtains the address list of the service provider from the registration center, calls the provider directly according to the load algorithm, and reports the call time to the monitoring center, which includes the network overhead

extended data:

Dubbo uses atomiclong to accumulate numbers from 0, encapsulates the packaged method call information (such as interface name, method name, parameter value list, etc.) and callback object callback of processing results, To form an object, put (ID, object) into the global concurrent HashMap which specially stores the call information, encapsulate the ID and packaged method call information into an object connrequest, and send it asynchronously using iosession. Write (connrequest)

the current thread then uses the get () method of callback to try to get the result of remote return. Within get (), synchronized is used to get the callback of the callback object callback, and then it is detected whether the result has been obtained. If not, then the wait () method of callback is called to release the lock on the callback so that the current thread is in wait state. p>

4.

What protocol is used for BBO internal communication
BBO supports a variety of remote calling methods, such as BBO RPC (binary serialization + TCP protocol), HTTP invoker (binary serialization + HTTP protocol, at least no support for text serialization is found in the open source version), Hessian (binary serialization + http Protocol), WebServices (text serialization + HTTP protocol), etc, But it lacks support for the rest style remote call (text serialization + HTTP protocol), which is very popular nowadays
in view of this, based on the standard Java rest API jax-rs 2.0 (short for Java API for restful web services), we provide nearly transparent rest call support for BBO. Because it is fully compatible with Java standard API, all rest services developed for BBO can run normally without BBO or any specific rest underlying implementation in the future

5. What protocol is used for BBO internal communication
BBO supports a variety of remote calling methods, such as BBO RPC (binary serialization + TCP protocol), HTTP invoker (binary serialization + HTTP protocol, at least no support for text serialization is found in the open source version), Hessian (binary serialization + http Protocol), WebServices (text serialization + HTTP protocol), etc, But it lacks support for the rest style remote call (text serialization + HTTP protocol), which is very popular nowadays
in view of this, based on the standard Java rest API jax-rs 2.0 (short for Java API for restful web services), we provide nearly transparent rest call support for BBO. Because it is fully compatible with Java standard API, all rest services developed for BBO can run normally without BBO or any specific rest underlying implementation in the future.
6. 1. What is Dubbo

Dubbo is a distributed service framework, which is dedicated to providing high-performance and transparent RPC remote service invocation scheme and SOA Service governance scheme. In short, BBO is a service framework. For example,
if there is no distributed requirement, it is unnecessary to use it. Only when it is distributed can there be the requirement of a distributed service framework such as BBO. In essence, BBO is a thing of service invocation. To put it bluntly, it is a distributed framework of remote service invocation, The core part of BBO is as follows:
1. Remote communication: provides a variety of abstract encapsulation of NiO framework based on long connection, including a variety of thread models, serialization, and "request response" mode of information exchange
2. Cluster fault tolerance: provide transparent remote procere call based on interface method, including multi protocol support, as well as cluster support such as soft load balancing, fault tolerance, address routing and dynamic configuration
3. Automatic discovery: Based on the registry directory service, the service consumer can dynamically find the service provider and make the address transparent, so that the service provider can smoothly increase or decrease the number of machines

2. What can Dubbo do

1. Transparent remote method call is just like calling local method. It only needs simple configuration and no API intrusion
2. The soft load balancing and fault tolerance mechanism can replace F5 and other hardware load balancers in the intranet to rece the cost and single point
3. Service automatic registration and discovery, no longer need to write the address of service provider, the registry queries the IP address of service provider based on the interface name, and can add or delete service provider smoothly

Dubbo adopts the full spring configuration mode, transparently accesses the application, and has no API intrusion to the application. It only needs spring to load Dubbo's configuration, and Dubbo is loaded based on spring's schema extension< Before

using web
service, I want to test the function or performance of the interface by simulating messages through soapUI or LR. But now, with Dubbo, the interfaces can't interact directly. I try to pass the simulated consumer address test, and the result is ugly. Then, I use JMeter to test with JUnit, but I still need to register with BBO. If I don't provide the source code, I can't do it, This test case is not easy to write...

3. BBO architecture

BBO architecture diagram is as follows:

node role description:

provider: the service provider that exposes the service

consumer: the service consumer that calls the remote service

registry: the registry of service registration and discovery

monitor: the monitoring center that counts the times and times of service calls

container: service running container

I think this is very good. The role is clear. You can determine whether the service is normal according to the status of each node role< Description of call relation:

0 the service container is responsible for starting, loading and running the service provider

1. When a service provider starts, it registers its services with the registry

2. When service consumers start up, they subscribe to the service they need from the registration center

3. The registration center returns the address list of service providers to consumers. If there is a change, the registration center will push the change data to consumers based on the long connection

4. Service consumers, from the address list of providers, select one provider to call based on soft load balancing algorithm, and if the call fails, select another one to call

5. Service consumers and providers accumulate call times and call time in memory, and regularly send statistical data to the monitoring center every minute

BBO's fault tolerance is obvious, and its performance has not yet been tested. We need to drop the interface for five times on a page of our system. Originally, we wanted to suggest a cache, but the business relationship can't be adopted. We need to study the performance tuning of BBO...

4. How to use BBO

Dubbo adopts the full spring configuration mode, transparently accesses the application, and has no API intrusion to the application. It only needs spring to load Dubbo's configuration, and Dubbo is loaded based on spring's schema extension. If you don't want to use spring configuration, but want to call through API (not recommended)

let's take a look at the writing method of spring configuration:

service provider:

1. Download zookeeper Registration Center, download address: after downloading, you can decompress, enter D: apache-zookeeper-3.4.5bin,

double click zkserver.cmd to start the registry service

2. Define the service interface: (the interface needs to be packaged separately and shared between the service provider and the consumer)

the following example is good. It is very detailed and can be a model.

package com.unj.bbotest.provider< br />
import java.util.List; < br />
public interface DemoService {

String sayHello(String name); < br />
public List getUsers();

}

implement the interface in the service provider: (hide the implementation from the service consumer)

package com.unj.bbotest.provider< br />
import java.util.ArrayList; < br />import java.util.LinkedList; < br />import java.util.List; < br />
public class DemoServiceImpl implements DemoService{

public String sayHello(String name) {
return " Hello " + name; < br />}
public List getUsers() {
List list = new ArrayList(); < br />User u1 = new User(); < br />u1.setName(" jack"); < br />u1.setAge(20); < br />u1.setSex(" Male & quot;)< br />
User u2 = new User(); < br />u2.setName(" tom"); < br />u2.setAge(21); < br />u2.setSex(" Female & quot;)< br />
User u3 = new User(); < br />u3.setName(" rose"); < br />u3.setAge(19); < br />u3.setSex(" Female & quot;)< br />
list.add(u1); < br />list.add(u2); < br />list.add(u3); < br />return list;
}
}

declare exposed services with spring configuration:

& lt; beans xmlns="& quot; < br /> xmlns:xsi="& quot; < br /> xmlns:bbo="& quot; < br /> xsi:schemaLocation=" < br />/spring-beans.xsd

/bbo.xsd
"& gt; < br />
<!-- Use the multicast broadcast registry to expose the service address
-- & gt

load the spring configuration and start the service:

package com.unj.bbotest.provider< br />
import org.springframework.context.support.; < br />
public class Provider {

public static void main(String[] args) throws Exception {
context = new (new String[] {" applicationContext.xml"}); < br />context.start(); < br />
System.in.read(); // To ensure that the service is always on, use the blocking of input stream to simulate
}

}

service consumer:

register the interfaces that I need to call in applicationcontext-bbo.xml. When I first started testing, I needed many interfaces, so I wrote this file full. Later, I became familiar with separating interfaces according to business types, More than n ApplicationContext BBO - * *. XML are written

1. Reference remote services through spring configuration:

& lt; beans xmlns="& quot; < br /> xmlns:xsi="& quot; xmlns:bbo="& quot; < br /> xsi:schemaLocation=" < br />/spring-beans.xsd

/bbo.xsd
"& gt; < br />
<!-- --& gt; < br />
< bbo:reference id=" demoService" < br />interface=" com.unj.bbotest.provider.DemoService" /& gt;

2. Load spring configuration and call remote service:

package com.alibaba.bbo.demo.pp< br />
import java.util.List; < br />
import org.springframework.context.support.; < br />
import com.unj.bbotest.provider.DemoService; < br />
public class Consumer {

public static void main(String[] args) throws Exception {
context = new (
new String[] { " applicationContext.xml" }); < br />context.start(); < br />
DemoService demoService = (DemoService) context.getBean(" demoService"); // < br />String hello = demoService.sayHello(" tom"); // ? < br />System.out.println(hello); // < br />
//
List list = demoService.getUsers(); < br />if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
System.out.println(list.get(i)); < br />}
}
// System.out.println(demoService.hehe()); < br />System.in.read(); < br />}

}
/
7. Add the following configuration on the consumer side
& lt; bbo:provider payload=" 104857600" /& gt;
8. 1. Transparent remote method call, just like local method call, only need simple configuration, no API intrusion
2. The soft load balancing and fault tolerance mechanism can replace F5 and other hardware load balancers in the intranet to rece the cost and single point
3. Service automatic registration and discovery, no longer need to write the address of service provider, the registry queries the IP address of service provider based on the interface name, and can add or delete service provider smoothly.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750