Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration Environment and related configuration of Dubbo

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains the "Dubbo configuration environment and related configuration", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "Dubbo configuration environment and related configuration" bar!

Catalogue

1. Related concepts of Dubbo

1.1 how automatic Service Discovery works

two。 Startup file

2.1 zookeeper-3.4.11\ bin\ zkServer.cmd

2.2 zookeeper-3.4.11\ bin\ zkCli.cmd

2.3 java-jar dubbo-admin-0.0.1-SNAPSHOT.jar

2.4 dubbo-monitor-simple-2.0.0\ assembly.bin\ start.bat

3. Modify the project file

3.1 Import related dependencies in the pom.xml file

3.2 configure dubbo in the application.properties file / src/main/resources/provider.xml file

3.2.1 provider

3.2.2 consumers

3.3 use annotations to turn on the function

4. Configuration file

4.1 priority of the profile

4.2 coverage relationships with different granularity configurations

4.3 turn off startup check check

4.4 timeout timeout

4.5 number of retries retries

More than 4.6 versions of version

4.7 Local stub stub

4.8There are three ways to integrate SpringBoot and Dubbo

1. Dubbo related concepts 1.1 how automatic service discovery works

two。 Startup file

This refers to the use of zookeeper as a registry; and start relevant dubbo monitoring

2.1 zookeeper-3.4.11\ bin\ zkServer.cmd

You can configure the port number and data data of the zookeeper client under the zookeeper-3.4.11\ conf path:

Run cmd under the zookeeper-3.4.11\ bin directory to start the zookeeper service:

2.2 zookeeper-3.4.11\ bin\ zkCli.cmd

Run cmd under the zookeeper-3.4.11\ bin directory to start the zookeeper client:

2.3 java-jar dubbo-admin-0.0.1-SNAPSHOT.jar

You can modify the port of the DubboWeb interface in the application.properties file under the path incubator-dubbo-ops-master\ dubbo-admin\ src\ main\ resources:

Open the command line under the project root path, execute mvn clean package to package the project into jar, and then execute the java-jar dubbo-admin-0.0.1-SNAPSHOT.jar command to run Dubbo

2.4 dubbo-monitor-simple-2.0.0\ assembly.bin\ start.bat

You can configure the monitoring page port in the dubbo.properties file under the dubbo-monitor-simple-2.0.0\ conf path:

Double-click to run the start.bat file under the dubbo-monitor-simple-2.0.0\ assembly.bin path:

3. Modify the project file

Need to make some changes to the project file; to turn on dubbo related functions

3.1 Import related dependencies in the pom.xml file 2.6.2 org.apache.curator curator-framework 2.12.03.2 configure the dubbo3.2.1 provider in the application.properties file / src/main/resources/provider.xml file 3.2.2 consumers

When integrating Dubbo with SpringBoot, the above information can be configured in the application.properties file. For more information, please see "three ways to integrate SpringBoot with Dubbo".

3.3.Use the annotation enable function annotated location function @ EnableDubbo to enable dubbo related functions the main launch class @ Service exposes the service provider provider@Reference to remotely invoke the service consumer consumer4. Configuration file

Dubbo's XML Schema configuration reference manual

Dubbo:consumer configuration

4.1 priority of the profile

JVM startup-D parameter first

XML takes second place.

Finally, Properties is equivalent to the default

4.2 coverage relationships with different granularity configurations

The higher the priority, the higher the priority.

Precision priority (method level first, interface level second, global configuration second)

Consumer setting priority (if the level is the same, the consumer takes priority, followed by the provider)

4.3 turn off startup check check

The provider has three configurations for shutting down the startup check registry:

Spring profile

Dubbo.properties

Dubbo.reference.com.foo.BarService.check=falsedubbo.reference.check=falsedubbo.consumer.check=falsedubbo.registry.check=false

Pass the-D parameter

Java-Ddubbo.reference.com.foo.BarService.check=falsejava-Ddubbo.reference.check=falsejava-Ddubbo.consumer.check=false java-Ddubbo.registry.check=false

Consumers have a configuration to turn off the startup check service provider:

4.4 timeout timeout

Provider:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report