You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by cr...@apache.org on 2023/08/28 11:36:19 UTC
[dubbo-website] branch master updated: change native image doc (#2798)
This is an automated email from the ASF dual-hosted git repository.
crazyhzm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/master by this push:
new 5f39cf75e52 change native image doc (#2798)
5f39cf75e52 is described below
commit 5f39cf75e5210e2ae9a2d0da5cc8d6e4e57de7e3
Author: huazhongming <cr...@gmail.com>
AuthorDate: Mon Aug 28 19:36:14 2023 +0800
change native image doc (#2798)
Signed-off-by: crazyhzm <cr...@gmail.com>
---
.../performance/support-graalvm.md | 70 ++++++++++++++++------
1 file changed, 53 insertions(+), 17 deletions(-)
diff --git a/content/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/performance/support-graalvm.md b/content/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/performance/support-graalvm.md
index 33b4af56c99..4eda2d6f0c8 100644
--- a/content/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/performance/support-graalvm.md
+++ b/content/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/performance/support-graalvm.md
@@ -2,8 +2,8 @@
aliases:
- /zh/docs3-v2/java-sdk/advanced-features-and-usage/performance/support-graalvm/
- /zh-cn/docs3-v2/java-sdk/advanced-features-and-usage/performance/support-graalvm/
-description: Dubbo 支持 Graal VM
-linkTitle: 支持 Graal VM
+description: Dubbo 支持 GraalVM Native Image
+linkTitle: 支持 GraalVM Native Image
title: 支持 Graal VM
type: docs
weight: 40
@@ -13,7 +13,7 @@ weight: 40
## 功能说明
-Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.0 项目接入 GraalVM,进行 native-image 编译为二进制的流程。
+Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.x 项目接入 GraalVM Native Image,进行 native-image 编译为二进制的流程以及目前支持的组件。
关于 GraalVm 的更多信息可以阅读 https://www.graalvm.org/docs/getting-started/container-images/ 此文档。
@@ -21,13 +21,13 @@ Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.0 项目接入
- 本机映像编译:将应用程序预编译为本机映像,缩短启动时间并减少内存使用。
- 语言互操作:GraalVM 能够用多种语言编写代码,在同一应用程序中进行互操作。
-
+
- 优化:GraalVM 为用 Java、JavaScript 和其他语言编写的应用程序提供优化,提高 Dubbo 应用程序的性能。
- Polyglot 调试:GraalVM 能够在同一会话中调试用多种语言编写的代码,对复杂 Dubbo 应用程序中的问题进行故障排除时非常有用。
- Java 运行时:可以在 GraalVM 上运行,提供更快、更高效的 Java 运行时环境。
-
+
- 开发微服务:可以与 GraalVM 结合,创建高性能、低资源利用率的微服务。
## 使用方式
@@ -37,8 +37,6 @@ Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.0 项目接入
1. 在Graalvm官网根据自己的系统选取对应Graalvm版本:https://www.graalvm.org/downloads/
2. 根据官方文档安装native-image:https://www.graalvm.org/latest/reference-manual/native-image/#install-native-image
-
-
### 第二步:配置profiles
其中包括maven-compiler-plugin、spring-boot-maven-plugin、native-maven-plugin、dubbo-maven-plugin,修改dubbo-maven-plugin中的mainClass为所需的启动类全路径。(其中API使用方式无需添加spring-boot-maven-plugin依赖。)
@@ -72,7 +70,7 @@ Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.0 项目接入
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
- <version>0.9.20</version>
+ <version>0.9.25</version>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
<metadataRepository>
@@ -115,7 +113,7 @@ Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.0 项目接入
### 第三步:在Pom依赖中添加native相关的依赖:
-其中API使用方式无需添加dubbo-config-spring6依赖。
+**其中API使用方式无需添加dubbo-config-spring6依赖**。
```xml
<dependency>
@@ -130,11 +128,7 @@ Dubbo3.2 支持 Native-Image 文档, 本文档将介绍将 dubbo3.0 项目接入
</dependency>
```
-### 第四步:调整compiler、proxy、serialization和logger
-
-- 序列化方式目前支持的比较好的是Fastjson2
-- compiler、proxy目前只能选择jdk
-- logger目前需要配置slf4j,目前仅支持logback
+### 第四步:配置应用
示例配置如下:
@@ -143,7 +137,6 @@ dubbo:
application:
name: ${spring.application.name}
logger: slf4j
- compiler: jdk
protocol:
name: dubbo
port: -1
@@ -156,10 +149,8 @@ dubbo:
metadata-report:
address: zookeeper://127.0.0.1:2181
provider:
- proxy: jdk
serialization: fastjson2
consumer:
- proxy: jdk
serialization: fastjson2
```
@@ -182,3 +173,48 @@ dubbo:
### 第六步:执行二进制文件即可
二进制文件在target/目录下,一般以工程名称为二进制包的名称,比如target/native-demo
+
+## 支持的组件以及对应的版本
+
+### 日志组件
+
+| 组件名称 | 所需的插件 | 插件版本 | 备注 |
+| ---------------------- | ------------------------ | ---------------------- | ------------------- |
+| Apache Commons Logging | native-maven-plugin | 0.9.24 及其以上 | |
+| JDK Logger | native-maven-plugin | 0.9.24 及其以上 | |
+| slf4j | spring-boot-maven-plugin | 3.x.x (用最新版本即可) | |
+| Log4j | | | 计划推动GraalVM支持 |
+| Log4j2 | | | |
+
+### 序列化组件
+
+| 组件名称 | 所需的插件 | 插件版本 | 备注 |
+| ------------ | ------------------- | --------------------------------------- | ---------------------------- |
+| FastJson2 | dubbo-maven-plugin | 3.3.0-beta.1-SNAPSHOT (Preview)及其以上 | |
+| JDK | native-maven-plugin | 0.9.24 及其以上 | |
+| Hessian-Lite | | | 对JDK 17支持不友好,暂不支持 |
+
+### 注册中心组件
+
+| 组件名称 | 所需的插件 | 插件版本 | 备注 |
+| --------- | ------------------ | ------------------------------- | ------------------------ |
+| Zookeeper | dubbo-maven-plugin | 3.3.0-beta.1-SNAPSHOT (Preview) | 仅支持Zookeeper Curator5 |
+
+### 元数据中心组件
+
+| 组件名称 | 所需的插件 | 插件版本 | 备注 |
+| --------- | ------------------ | ------------------------------- | ------------------------ |
+| Zookeeper | dubbo-maven-plugin | 3.3.0-beta.1-SNAPSHOT (Preview) | 仅支持Zookeeper Curator5 |
+
+### 配置中心组件
+
+| 组件名称 | 所需的插件 | 插件版本 | 备注 |
+| --------- | ------------------ | ------------------------------- | ------------------------ |
+| Zookeeper | dubbo-maven-plugin | 3.3.0-beta.1-SNAPSHOT (Preview) | 仅支持Zookeeper Curator5 |
+
+### 可观测性组件
+
+| 组件名称 | 所需的插件 | 插件版本 | 备注 |
+| ---------- | ---------- | -------- | ---- |
+| Micrometer | | | |
+