Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
443 changed files
with
28,239 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
--- | ||
type: docs | ||
title: "Java" | ||
weight: 10 | ||
no_list: true | ||
hide_summary: true | ||
description: "Java SDK Manual" | ||
--- | ||
|
||
- Quick start: | ||
- [Spring Boot Quick Development Dubbo Service](quick-start/spring-boot/) | ||
- [Configuration Reference Manual](reference-manual/config/) | ||
- Advanced features: | ||
- [Extended Filter, Router to intercept traffic](concepts-and-architecture/service-invocation/) | ||
- Reference book: | ||
- [Registry Configuration Guide](reference-manual/registry/) | ||
- Upgrades and Compatibility: | ||
- [3.0 Migration Guide](upgrades-and-compatibility/) |
11 changes: 11 additions & 0 deletions
11
content/en/docs3-v2/java-sdk/advanced-features-and-usage/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
--- | ||
type: docs | ||
title: "Advanced Features" | ||
linkTitle: "Advanced Features" | ||
weight: 4 | ||
no_list: true | ||
hide_summary: true | ||
description: "The following is a list of all functions supported by Dubbo, browse directly on this page or view them by category on the left menu." | ||
--- | ||
|
8 changes: 8 additions & 0 deletions
8
content/en/docs3-v2/java-sdk/advanced-features-and-usage/others/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
--- | ||
type: docs | ||
title: "Others" | ||
linkTitle: "Others" | ||
weight: 5 | ||
--- | ||
|
70 changes: 70 additions & 0 deletions
70
.../docs3-v2/java-sdk/advanced-features-and-usage/others/dubbo-kubernetes-probe.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
type: docs | ||
title: "Kubernetes Probe" | ||
linkTitle: "Kubernetes Probe" | ||
weight: 5 | ||
description: "Understand the extension and application scenarios of Dubbo3 and Kubernetes life cycle alignment probe" | ||
--- | ||
|
||
## Feature description | ||
[Pod lifecycle](https://kubernetes.io/zh/docs/concepts/workloads/pods/pod-lifecycle/) is closely related to service scheduling. Through the implementation of official Kubernetes probes, Dubbo3 and even the entire application can The life cycle of the Pod and the life cycle of the Pod. In the entire life cycle of the Pod, only the health check part of the Pod is affected. We can configure the liveness probe (survival probe) and readiness probe (readability probe) to Affects the life cycle of the container. | ||
|
||
Through the SPI mechanism of Dubbo3, various "probes" are implemented internally, based on the HTTP service of the Dubbo3 QOS operation and maintenance module, so that the container probe can obtain the status of the corresponding probe in the application. In addition, the implementation mechanism of SPI is also conducive to users' self-expanding of internal "probes", so that the entire application life cycle can be more effectively controlled. | ||
|
||
**SPI interfaces corresponding to the three probes** | ||
|
||
- livenessProbe: `org.apache.dubbo.qos.probe.LivenessProbe` | ||
- readinessProbe: `org.apache.dubbo.qos.probe.ReadinessProbe` | ||
- startupProbe: `org.apache.dubbo.qos.probe.StartupProbe` | ||
|
||
The interface will automatically obtain the implementation of all SPIs of the current application, and the interface will return success if the SPI implementations of the corresponding interface are successfully ready. | ||
|
||
For an introduction to more extensions of Dubbo3 SPI, see [Dubbo SPI Extensions](/en/docs3-v2/java-sdk/reference-manual/spi/description/) | ||
|
||
## scenes to be used | ||
- kubelet uses `liveness probe` to determine if your application is running, to see if it is alive. Generally speaking, if your program crashes, Kubernetes will immediately know that the program has terminated, and then restart the program. The purpose of our liveness probe is to capture that the current application has not terminated or crashed. If these situations occur, restart the container in this state so that the application can still continue in the presence of bugs run down. | ||
- The kubelet uses `readiness probe` to determine if the container is ready to receive traffic. Is it ready and ready to work now. Only when the containers in the Pod are all in the ready state, the kubelet will consider the Pod to be in the ready state, because there may be multiple containers under a Pod. If the Pod is not ready, we will remove it from the Service's Endpoints list, so that our traffic will not be routed to the Pod. | ||
|
||
## How to use | ||
|
||
### Survival detection | ||
|
||
For the livenessProbe liveness detection, since the Dubbo3 framework itself cannot obtain the liveness status of the application, this interface has no default implementation and returns success by default. Developers can expand this SPI interface according to the SPI definition, and judge whether it is alive or not from the application level. | ||
|
||
About [liveness liveness probe](../../../reference-manual/spi/description/liveness/) extension example | ||
### Readiness check | ||
|
||
For the readinessProbe readiness detection, Dubbo3 currently provides two detection dimensions by default. One is to judge whether the Dubbo3 service itself is started or stopped, and the other is to check whether all services have registered interfaces. If all services have been offline from the registration center (you can Operate via QOS Operations) will return Not Ready. | ||
|
||
About the [readiness readiness probe](../../../reference-manual/spi/description/readiness/) extended example | ||
|
||
### Start detection | ||
|
||
For startupProbe startup detection, Dubbo3 currently provides a detection dimension by default, which is to return to the ready state after all startup processes (interface exposure, registration center writing, etc.) are completed. | ||
|
||
About the [startup startup probe](../../../reference-manual/spi/description/startup/) extended example | ||
|
||
### Reference example | ||
```yaml | ||
livenessProbe: | ||
httpGet: | ||
path: /live | ||
port: 22222 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 22222 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
startupProbe: | ||
httpGet: | ||
path: /startup | ||
port: 22222 | ||
failureThreshold: 30 | ||
periodSeconds: 10 | ||
``` | ||
> QOS When the computing node detects memory pressure, kuberentes will BestEffort -> Burstable -> Guaranteed to evict Pods in sequence. | ||
At present, all three probes have corresponding interfaces, and the path is the command in QOS. Please modify the port information according to the QOS configuration (the default port is 22222). For other parameters, please refer to [Kubernetes official documentation](https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). |
50 changes: 50 additions & 0 deletions
50
...nt/en/docs3-v2/java-sdk/advanced-features-and-usage/others/graceful-shutdown.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
type: docs | ||
title: "Graceful shutdown" | ||
linkTitle: "Graceful shutdown" | ||
weight: 2 | ||
description: "Let the Dubbo service complete graceful shutdown" | ||
--- | ||
|
||
## Feature description | ||
|
||
Graceful shutdown means that the service instance can be stopped safely and smoothly without affecting the ongoing business. | ||
A Dubbo service may be both a service provider and a service consumer. When the service is stopped: | ||
1. Consumers will no longer request stopped service instances | ||
2. The request being processed by the service instance can be processed normally | ||
|
||
## scenes to be used | ||
|
||
1. Stop the service with `kill PID` | ||
2. Stop the service through `/shutdown` of SpringBoot Actuator | ||
|
||
Dubbo 3.0 and above supports different types of Java applications, including SpringBoot applications, Spring applications, and non-Spring applications. | ||
|
||
## How to use | ||
|
||
Set the graceful shutdown timeout, the default timeout is 10 seconds, if it times out, it will be forced to shut down. | ||
This parameter can be configured in the dubbo.properties file, for example: 30 seconds. | ||
```properties | ||
# Stop service waiting time, unit: milliseconds | ||
dubbo.service.shutdown.wait=30000 | ||
``` | ||
|
||
## Precautions | ||
|
||
1. Dubbo uses JDK's ShutdownHook to complete graceful shutdown, so if the user uses `kill -9 PID` and other forced shutdown commands, it will not execute graceful shutdown, and will only execute when `kill PID` is passed. | ||
|
||
2. Verify that Dubbo's ShutdownHook is executed. You can find the keyword in the log file: `Run shutdown hook now.` | ||
|
||
3. If Spring is used, please upgrade to version 4.2 and above, it is recommended to use version 5 or above | ||
|
||
4. If SpringBoot is used, Dubbo's ShutdownHook will be executed before SpringBoot's ShutdownHook, | ||
If you use SpringBoot 2.3 and above, it is recommended to use it with SpringBoot's graceful shutdown, and configure it in the configuration file application.yml: | ||
```yml | ||
server: | ||
shutdown: graceful | ||
``` | ||
|
||
5. If the ShutdownHook does not take effect, you can call it yourself according to the specific scenario: | ||
```java | ||
ApplicationModel.defaultModel().destroy(); | ||
``` |
120 changes: 120 additions & 0 deletions
120
...nt/en/docs3-v2/java-sdk/advanced-features-and-usage/others/logger-management.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
type: docs | ||
title: "Log Framework Adaptation and Runtime Management" | ||
linkTitle: "Log framework adaptation and runtime management" | ||
weight: 4 | ||
description: "Adapt to the log framework in Dubbo and support dynamic switching of the log framework used at runtime" | ||
--- | ||
## Feature description | ||
Adaptation of log frameworks. Since `2.2.1`, dubbo has built-in adaptation of log4j, slf4j, jcl, and jdk log frameworks. | ||
|
||
Log framework runtime management, starting from `3.0.10`, dubbo-qos runtime management supports query log configuration and dynamically modify the used log framework and log level. | ||
|
||
> The log configuration modified by dubbo-qos is not stored persistently, and will become invalid after the application is restarted. | ||
## scenes to be used | ||
|
||
## How to use | ||
## Log framework adaptation | ||
The logging output policy can be explicitly configured in the following ways | ||
|
||
### 1. Command line | ||
|
||
```sh | ||
java -Ddubbo.application.logger=log4j | ||
``` | ||
|
||
### 2. Specify in `dubbo.properties` | ||
|
||
``` | ||
dubbo.application.logger=log4j | ||
``` | ||
|
||
### 3. Configuration in `dubbo.xml` | ||
|
||
```xml | ||
<dubbo:application logger="log4j" /> | ||
``` | ||
|
||
For custom extensions, please refer to [Log Adapter Extension](../../../reference-manual/spi/description/logger-adapter) | ||
|
||
## Logging framework runtime management | ||
### 1. Query log configuration | ||
|
||
Command: `loggerInfo` | ||
|
||
**example** | ||
```bash | ||
> telnet 127.0.0.1 22222 | ||
> loggerInfo | ||
``` | ||
|
||
**output** | ||
``` | ||
Trying 127.0.0.1... | ||
Connected to localhost. | ||
Escape character is '^]'. | ||
___ __ __ ___ ___ ____ | ||
/ _ \ / / / // _ ) / _ ) / __ \ | ||
/ // // /_/ // _ |/ _ |/ /_/ / | ||
/____/ \____//____//____/ \____/ | ||
dubbo>loggerInfo | ||
Available logger adapters: [jcl, jdk, log4j, slf4j]. Current Adapter: [log4j]. Log level: INFO | ||
``` | ||
|
||
### 2. Modify log level | ||
|
||
Command: `switchLogLevel {level}` | ||
|
||
level: `ALL`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF` | ||
|
||
**example** | ||
```bash | ||
> telnet 127.0.0.1 22222 | ||
> switchLogLevel WARN | ||
``` | ||
|
||
**output** | ||
``` | ||
Trying 127.0.0.1... | ||
Connected to localhost. | ||
Escape character is '^]'. | ||
___ __ __ ___ ___ ____ | ||
/ _ \ / / / // _ ) / _ ) / __ \ | ||
/ // // /_/ // _ |/ _ |/ /_/ / | ||
/____/ \____//____//____/ \____/ | ||
dubbo>loggerInfo | ||
Available logger adapters: [jcl, jdk, log4j, slf4j]. Current Adapter: [log4j]. Log level: INFO | ||
dubbo>switchLogLevel WARN | ||
OK | ||
dubbo>loggerInfo | ||
Available logger adapters: [jcl, jdk, log4j, slf4j]. Current Adapter: [log4j]. Log level: WARN``` | ||
``` | ||
### 3. Modify the log output framework | ||
Command: `switchLogger {loggerAdapterName}` | ||
loggerAdapterName: `slf4j`, `jcl`, `log4j`, `jdk`, `log4j2` | ||
**example** | ||
```bash | ||
> telnet 127.0.0.1 22222 | ||
> switchLogger slf4j | ||
``` | ||
|
||
**output** | ||
``` | ||
Trying 127.0.0.1... | ||
Connected to localhost. | ||
Escape character is '^]'. | ||
___ __ __ ___ ___ ____ | ||
/ _ \ / / / // _ ) / _ ) / __ \ | ||
/ // // /_/ // _ |/ _ |/ /_/ / | ||
/____/ \____//____//____/ \____/ | ||
dubbo>loggerInfo | ||
Available logger adapters: [jcl, slf4j, log4j, jdk]. Current Adapter: [log4j]. Log level: INFO | ||
dubbo>switchLogger slf4j | ||
OK | ||
dubbo>loggerInfo | ||
Available logger adapters: [jcl, slf4j, log4j, jdk]. Current Adapter: [slf4j]. Log level: INFO | ||
``` |
Oops, something went wrong.