You do not know the direct mode dubbo

dubbo Direct Connect mode

  1. Scenarios

When used for testing, bypassing the registration center, convenient to troubleshoot errors.

  1. Configuration

Direct configuration mode does not need to make any changes on the provider end, you only need to make changes (as red line) to spring.xml consumer side, the two ends are as follows:

--provider side content:

--consumer side content:

Remarks:

1) All the service provider side are registered to the 2181, consumer end of 2182 only declare registry, and then detect whether access to OrdersApi service?

2) because then UserApi not found in 2182, you need to specify check = "false" otherwise an error when you start tomcat, even so, when accessing / getusers No abnormal provider also reported the same reason.

3) If you need to direct a plurality of addresses between addresses "," was separated.

  1. test

After the configuration, through the browser to http: // localhost: 8080 / crmweb / getorders, success.

  1. Analysis of the pros and cons

Arranged independently of each other between 1) interface and an interface, A is directly connected with registration do not affect the heart with B

2) to bypass the registration center to achieve point to point connection, but limited use scenario, commonly used in the test

3) can not support cluster

4) address of the service is no longer transparent, to address the need for maintenance, the situation is not conducive to large-scale service

  1. operation

1) direct after a successful start dubbo-admin center to see if there are 2182 registered providers and consumers?

No OrdersApi providers and consumers, but there are userApi consumers.

2) other configuration unchanged, delete url = "dubbo: //127.0.0.1: 20880" after getorders is available?

No, suggesting no provider.

3) other configuration unchanged, delete url = "dubbo: //127.0.0.1: 20880", together with the 2181 registry configuration, getorders is available? As follows:

A: available because the service can find the appropriate registry by 2181.

(end)

No public attention below to find out more wonderful

file

For more resources please pay attention to micro-channel public number: AKA procedure king

Guess you like

Origin www.cnblogs.com/akachengxuwang/p/11715034.html