This is an automated email from the ASF dual-hosted git repository.
liujun 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 a35099b 3.0 docs, add quick start & what's new (#868)
a35099b is described below
commit a35099bbaf7ee9a320cd6fe239f4c4f4e4527257
Author: ken.lj <[email protected]>
AuthorDate: Thu Jul 15 16:51:53 2021 +0800
3.0 docs, add quick start & what's new (#868)
---
content/zh/docs/v3.0/examples/idl-service.md | 9 -
content/zh/docs/v3.0/examples/quick-start.md | 124 ++++++++++++-
content/zh/docs/v3.0/languages/_index.md | 1 -
.../zh/docs/v3.0/languages/golang/go-specific.md | 0
.../zh/docs/v3.0/languages/golang/quick-start.md | 203 +++++++++++++++++++++
.../languages/java/configuration/annotation.md | 97 ++++++++++
.../docs/v3.0/languages/java/configuration/api.md | 127 +++++++++++++
.../languages/java/configuration/config-center.md | 149 +++++++++++++++
.../languages/java/configuration/properties.md | 44 +++++
.../docs/v3.0/languages/java/configuration/xml.md | 98 ++++++++++
.../zh/docs/v3.0/languages/java/java-specific.md | 107 +++++++++++
content/zh/docs/v3.0/languages/java/quick-start.md | 188 +++++++++++++++++++
content/zh/docs/v3.0/new-in-dubbo3.md | 96 +++++++++-
content/zh/docs/v3.0/references/protobuf/_index.md | 7 +
content/zh/docs/v3.0/references/protobuf/idl.md | 12 ++
15 files changed, 1245 insertions(+), 17 deletions(-)
diff --git a/content/zh/docs/v3.0/examples/idl-service.md
b/content/zh/docs/v3.0/examples/idl-service.md
deleted file mode 100644
index bdaebe0..0000000
--- a/content/zh/docs/v3.0/examples/idl-service.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-type: docs
-title: "使用 IDL 定义 Dubbo 服务"
-linkTitle: "服务定义"
-weight: 20
-description: "尝试使用 IDL 定义服务"
----
-
-
diff --git a/content/zh/docs/v3.0/examples/quick-start.md
b/content/zh/docs/v3.0/examples/quick-start.md
index 0c05975..7fe4c5e 100644
--- a/content/zh/docs/v3.0/examples/quick-start.md
+++ b/content/zh/docs/v3.0/examples/quick-start.md
@@ -6,11 +6,123 @@ weight: 10
description: ""
---
-Dubbo 集成了多种开发模式,以下简单
-* Raw API
-* Spring / Spring Boot Starter
-* 配置文件
+## 定义服务
+Dubbo3 推荐使用 IDL 定义跨语言服务,如期望使用特定语言的服务定义方式请移步[多语言](../../languages)模块。
-## Java
+服务是 Dubbo 中的核心概念,一个服务代表一组 RPC 方法的集合,服务是面向用户编程、服务发现机制等的基本单位。基本流程是,用户定义 RPC
服务,通过约定的配置
+方式将 RPC 声明为 Dubbo 服务,然后就可以基于服务进行编程了,对服务提供者来说,是提供 RPC
服务的具体实现,对服务消费者来说,则是使用特定数据发起服务调用。
-## GO
+```text
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.dubbo.demo";
+option java_outer_classname = "DemoServiceProto";
+option objc_class_prefix = "DEMOSRV";
+
+package demoservice;
+
+// The demo service definition.
+service DemoService {
+ rpc SayHello (HelloRequest) returns (HelloReply) {}
+}
+
+// The request message containing the user's name.
+message HelloRequest {
+ string name = 1;
+}
+
+// The response message containing the greetings
+message HelloReply {
+ string message = 1;
+}
+
+```
+
+以下是使用 IDL 定义服务的一个简单示例,我们可以把它命名为 `DemoService.proto`,proto 文件中定义了 RPC 服务名称
`DemoService` 与方法签名
+ `SayHello (HelloRequest) returns (HelloReply) {}`,同时还定义了方法的入参结构体、出参结构体
`HelloRequest` 与 `HelloResponse`。
+ IDL 格式的服务依赖 Protobuf 编译器,用来生成可以被用户调用的客户端与服务端编程 API,Dubbo 在原生 Protobuf
Compiler 的基础上提供了适配多种语言的特有插件,用于适配 Dubbo 框架特有的 API 与编程模型。
+
+> 使用 Dubbo3 IDL 定义的服务只允许一个入参与出参,这更有利于多语言实现与向后兼容性,支持依赖 Protobuf
序列化的向后兼容性透明的增删字段。
+
+## 编译服务
+根据当前采用的语言,配置配套的 Protobuf 插件,编译后将生产语言相关的服务定义 stub。
+
+### Java
+Java 语言生成的 stub 如下,核心是一个接口定义
+```java
[email protected](
+value = "by Dubbo generator",
+comments = "Source: DemoService.proto")
+public interface DemoService {
+ static final String JAVA_SERVICE_NAME =
"org.apache.dubbo.demo.DemoService";
+ static final String SERVICE_NAME = "demoservice.DemoService";
+
+ org.apache.dubbo.demo.HelloReply
sayHello(org.apache.dubbo.demo.HelloRequest request);
+
+ CompletableFuture<org.apache.dubbo.demo.HelloReply>
sayHelloAsync(org.apache.dubbo.demo.HelloRequest request);
+}
+```
+
+### Golang
+
+
+## 配置并加载服务
+提供端负责提供具体的 Dubbo 服务实现,也就是遵循 RPC 签名所约束的格式,去实现具体的业务逻辑代码。在实现服务之后,要将服务实现注册为标准的
Dubbo 服务,
+之后 Dubbo 框架就能根据接收到的请求转发给服务实现,执行方法,并将结果返回。
+
+消费端的配置会更简单一些,只需要声明 IDL 定义的服务为标准的 Dubbo 服务,框架就可以帮助开发者生成相应的 proxy,开发者将完全面向 proxy
编程,
+基本上 Dubbo 所有语言的实现都保证了 proxy 依据 IDL 服务定义暴露标准化的接口。
+
+### Java
+提供端,实现服务
+```java
+public class DemoServiceImpl implements DemoService {
+ private static final Logger logger =
LoggerFactory.getLogger(DemoServiceImpl.class);
+
+ @Override
+ public HelloReply sayHello(HelloRequest request) {
+ logger.info("Hello " + request.getName() + ", request from consumer: "
+ RpcContext.getContext().getRemoteAddress());
+ return HelloReply.newBuilder()
+ .setMessage("Hello " + request.getName() + ", response from
provider: "
+ + RpcContext.getContext().getLocalAddress())
+ .build();
+ }
+
+ @Override
+ public CompletableFuture<HelloReply> sayHelloAsync(HelloRequest request) {
+ return CompletableFuture.completedFuture(sayHello(request));
+ }
+}
+```
+
+提供端,注册服务(以 Spring XML 为例)
+```xml
+<bean id="demoServiceImpl"
class="org.apache.dubbo.demo.provider.DemoServiceImpl"/>
+<dubbo:service serialization="protobuf"
interface="org.apache.dubbo.demo.DemoService" ref="demoServiceImpl"/>
+```
+
+消费端,引用服务
+```xml
+<dubbo:reference scope="remote" id="demoService" check="false"
interface="org.apache.dubbo.demo.DemoService"/>
+```
+
+消费端,使用服务 proxy
+```java
+public void callService() throws Exception {
+ ...
+ DemoService demoService = context.getBean("demoService",
DemoService.class);
+ HelloRequest request = HelloRequest.newBuilder().setName("Hello").build();
+ HelloReply reply = demoService.sayHello(request);
+ System.out.println("result: " + reply.getMessage());
+}
+```
+
+### Golang
+
+
+## 查看完整示例
+* [Java Quick Start](../../languages/java/quick-start)
+* [Golang Quick Start](../../languages/golang/quick-start)
+* [Java 语言特定用法](../../languages/java/java-specific)
+* [Golang 语言特定用法](../../languages/golang/go-specific)
diff --git a/content/zh/docs/v3.0/languages/_index.md
b/content/zh/docs/v3.0/languages/_index.md
index fe6231a..e692ad4 100755
--- a/content/zh/docs/v3.0/languages/_index.md
+++ b/content/zh/docs/v3.0/languages/_index.md
@@ -6,4 +6,3 @@ linkTitle: "多语言"
weight: 60
description: "Dubbo 社区提供了丰富的多语言 sdk 支持,请在此了解每种语言的特殊用法"
---
-
diff --git a/content/zh/docs/v3.0/languages/golang/go-specific.md
b/content/zh/docs/v3.0/languages/golang/go-specific.md
new file mode 100644
index 0000000..e69de29
diff --git a/content/zh/docs/v3.0/languages/golang/quick-start.md
b/content/zh/docs/v3.0/languages/golang/quick-start.md
new file mode 100644
index 0000000..dd55796
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/golang/quick-start.md
@@ -0,0 +1,203 @@
+---
+title: 快速开始
+keywords: 快速开始, hellowworld, Provider
+description: 快速上手dubbo-go,编写一个简单的hellowworld应用
+---
+
+推荐[使用 IDL](../../../examples/quick-start) 定义跨语言的服务与编码格式,以下展示的是 Golang
语言版本的服务定义与开发方式,如果你有遗留系统或无多语言开发需求,可参考以下使用方式。
+
+# 快速开始
+
+通过一个 `hellowworld` 例子带领大家快速上手Dubbo-go框架。
+
+协议:Dubbo
+编码:Hessian2
+注册中心:Zookeeper
+
+## 环境
+
+* Go编程环境
+* 启动zookeeper服务,也可以使用远程实例
+
+## 从服务端开始
+
+### 第一步:编写 `Provider` 结构体和提供服务的方法
+
+>
<https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-server/app/user.go>
+
+1. 编写需要被编码的结构体,由于使用 `Hessian2` 作为编码协议,`User` 需要实现 `JavaClassName`
方法,它的返回值在dubbo中对应User类的类名。
+
+```go
+type User struct {
+ Id string
+ Name string
+ Age int32
+ Time time.Time
+}
+
+func (u User) JavaClassName() string {
+ return "com.ikurento.user.User"
+}
+```
+
+2. 编写业务逻辑,`UserProvider` 相当于dubbo中的一个服务实现。需要实现 `Reference`
方法,返回值是这个服务的唯一标识,对应dubbo的 `beans` 和 `path` 字段。
+
+```go
+type UserProvider struct {
+}
+
+func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User,
error) {
+ println("req:%#v", req)
+ rsp := User{"A001", "hellowworld", 18, time.Now()}
+ println("rsp:%#v", rsp)
+ return &rsp, nil
+}
+
+func (u *UserProvider) Reference() string {
+ return "UserProvider"
+}
+```
+
+3. 注册服务和对象
+
+```go
+func init() {
+ config.SetProviderService(new(UserProvider))
+ // ------for hessian2------
+ hessian.RegisterPOJO(&User{})
+}
+```
+
+### 第二步:编写主程序
+
+>
<https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-server/app/server.go>
+
+1. 引入必需的dubbo-go包
+
+```go
+import (
+ hessian "github.com/apache/dubbo-go-hessian2"
+ "github.com/apache/dubbo-go/config"
+ _ "github.com/apache/dubbo-go/registry/protocol"
+ _ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+ _ "github.com/apache/dubbo-go/filter/impl"
+ _ "github.com/apache/dubbo-go/cluster/cluster_impl"
+ _ "github.com/apache/dubbo-go/cluster/loadbalance"
+ _ "github.com/apache/dubbo-go/registry/zookeeper"
+
+ _ "github.com/apache/dubbo-go/protocol/dubbo"
+)
+
+```
+
+2. main 函数
+
+```go
+func main() {
+ config.Load()
+}
+```
+
+### 第三步:编写配置文件并配置环境变量
+
+1. 参考
[log](https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-server/profiles/release/log.yml)
和
[server](https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-server/profiles/release/server.yml)
编辑配置文件。
+
+主要编辑以下部分:
+
+* `registries` 结点下需要配置zk的数量和地址
+
+* `services` 结点下配置服务的具体信息,需要配置 `interface` 配置,修改为对应服务的接口名,服务的key对应第一步中
`Provider` 的 `Reference` 返回值
+
+2. 把上面的两个配置文件分别配置为环境变量
+
+```shell
+export CONF_PROVIDER_FILE_PATH="xxx"
+export APP_LOG_CONF_FILE="xxx"
+```
+
+## 接着是客户端
+
+### 第一步:编写客户端 `Provider`
+
+>
<https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-client/app/user.go>
+
+1. 参考服务端第一步的第一点。
+
+2. 与服务端不同的是,提供服务的方法作为结构体的参数,不需要编写具体业务逻辑。另外,`Provider` 不对应dubbo中的接口,而是对应一个实现。
+
+```go
+type UserProvider struct {
+ GetUser func(ctx context.Context, req []interface{}, rsp *User) error
+}
+
+func (u *UserProvider) Reference() string {
+ return "UserProvider"
+}
+```
+
+3. 注册服务和对象
+
+```go
+func init() {
+ config.SetConsumerService(userProvider)
+ hessian.RegisterPOJO(&User{})
+}
+```
+
+### 第二步:编写客户端主程序
+
+>
<https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-client/app/client.go>
+
+1. 引入必需的dubbo-go包
+
+```go
+import (
+ hessian "github.com/apache/dubbo-go-hessian2"
+ "github.com/apache/dubbo-go/config"
+ _ "github.com/apache/dubbo-go/registry/protocol"
+ _ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+ _ "github.com/apache/dubbo-go/filter/impl"
+ _ "github.com/apache/dubbo-go/cluster/cluster_impl"
+ _ "github.com/apache/dubbo-go/cluster/loadbalance"
+ _ "github.com/apache/dubbo-go/registry/zookeeper"
+
+ _ "github.com/apache/dubbo-go/protocol/dubbo"
+)
+```
+
+2. main 函数
+
+```go
+func main() {
+ config.Load()
+ time.Sleep(3e9)
+
+ println("\n\n\nstart to test dubbo")
+ user := &User{}
+ err := userProvider.GetUser(context.TODO(), []interface{}{"A001"}, user)
+ if err != nil {
+ panic(err)
+ }
+ println("response result: %v\n", user)
+}
+func println(format string, args ...interface{}) {
+ fmt.Printf("\033[32;40m"+format+"\033[0m\n", args...)
+}
+```
+
+### 第三步:编写配置文件并配置环境变量
+
+1. 参考
[log](https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-client/profiles/release/log.yml)
和
[client](https://github.com/dubbogo/dubbo-samples/blob/master/golang/helloworld/dubbo/go-client/profiles/release/client.yml)
编辑配置文件。
+
+主要编辑以下部分:
+
+* `registries` 结点下需要配置zk的数量和地址
+
+* `references` 结点下配置服务的具体信息,需要配置 `interface` 配置,修改为对应服务的接口名,服务的key对应第一步中
`Provider` 的 `Reference` 返回值
+
+2. 把上面的两个配置文件费别配置为环境变量,为防止log的环境变量和服务端的log环境变量冲突,建议所有的环境变量不要做全局配置,在当前起效即可。
+
+```shell
+export CONF_CONSUMER_FILE_PATH="xxx"
+export APP_LOG_CONF_FILE="xxx"
+```
diff --git a/content/zh/docs/v3.0/languages/java/configuration/annotation.md
b/content/zh/docs/v3.0/languages/java/configuration/annotation.md
new file mode 100644
index 0000000..63a1469
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/configuration/annotation.md
@@ -0,0 +1,97 @@
+---
+type: docs
+title: "注解配置"
+linkTitle: "注解配置"
+weight: 4
+description: "以注解配置的方式来配置你的 Dubbo 应用"
+---
+
+{{% alert title="提示" color="primary" %}}
+需要 `2.6.3` 及以上版本支持。 点此查看
[完整示例](https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-annotation)
+{{% /alert %}}
+
+
+## 服务提供方
+
+### `Service`注解暴露服务
+
+```java
+@Service
+public class AnnotationServiceImpl implements AnnotationService {
+ @Override
+ public String sayHello(String name) {
+ return "annotation: hello, " + name;
+ }
+}
+```
+
+### 增加应用共享配置
+
+```properties
+# dubbo-provider.properties
+dubbo.application.name=annotation-provider
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+dubbo.protocol.name=dubbo
+dubbo.protocol.port=20880
+```
+
+### 指定Spring扫描路径
+
+```java
+@Configuration
+@EnableDubbo(scanBasePackages =
"org.apache.dubbo.samples.simple.annotation.impl")
+@PropertySource("classpath:/spring/dubbo-provider.properties")
+static public class ProviderConfiguration {
+
+}
+```
+
+## 服务消费方
+
+### `Reference`注解引用服务
+
+```java
+@Component("annotationAction")
+public class AnnotationAction {
+
+ @Reference
+ private AnnotationService annotationService;
+
+ public String doSayHello(String name) {
+ return annotationService.sayHello(name);
+ }
+}
+
+```
+
+### 增加应用共享配置
+
+```properties
+# dubbo-consumer.properties
+dubbo.application.name=annotation-consumer
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+dubbo.consumer.timeout=3000
+```
+
+### 指定Spring扫描路径
+
+```java
+@Configuration
+@EnableDubbo(scanBasePackages =
"org.apache.dubbo.samples.simple.annotation.action")
+@PropertySource("classpath:/spring/dubbo-consumer.properties")
+@ComponentScan(value = {"org.apache.dubbo.samples.simple.annotation.action"})
+static public class ConsumerConfiguration {
+
+}
+```
+
+### 调用服务
+
+```java
+public static void main(String[] args) throws Exception {
+ AnnotationConfigApplicationContext context = new
AnnotationConfigApplicationContext(ConsumerConfiguration.class);
+ context.start();
+ final AnnotationAction annotationAction = (AnnotationAction)
context.getBean("annotationAction");
+ String hello = annotationAction.doSayHello("world");
+}
+```
diff --git a/content/zh/docs/v3.0/languages/java/configuration/api.md
b/content/zh/docs/v3.0/languages/java/configuration/api.md
new file mode 100644
index 0000000..ba92508
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/configuration/api.md
@@ -0,0 +1,127 @@
+---
+type: docs
+title: "API 配置"
+linkTitle: "API 配置"
+weight: 3
+description: "以API 配置的方式来配置你的 Dubbo 应用"
+---
+
+API
属性与配置项一对一,各属性含义,请参见:[配置参考手册](../references/xml/),比如:`ApplicationConfig.setName("xxx")`
对应 `<dubbo:application name="xxx" />` [^1]
+
+## 服务提供者
+
+```java
+import org.apache.dubbo.rpc.config.ApplicationConfig;
+import org.apache.dubbo.rpc.config.RegistryConfig;
+import org.apache.dubbo.rpc.config.ProviderConfig;
+import org.apache.dubbo.rpc.config.ServiceConfig;
+import com.xxx.XxxService;
+import com.xxx.XxxServiceImpl;
+
+// 服务实现
+XxxService xxxService = new XxxServiceImpl();
+
+// 当前应用配置
+ApplicationConfig application = new ApplicationConfig();
+application.setName("xxx");
+
+// 连接注册中心配置
+RegistryConfig registry = new RegistryConfig();
+registry.setAddress("10.20.130.230:9090");
+registry.setUsername("aaa");
+registry.setPassword("bbb");
+
+// 服务提供者协议配置
+ProtocolConfig protocol = new ProtocolConfig();
+protocol.setName("dubbo");
+protocol.setPort(12345);
+protocol.setThreads(200);
+
+// 注意:ServiceConfig为重对象,内部封装了与注册中心的连接,以及开启服务端口
+
+// 服务提供者暴露服务配置
+ServiceConfig<XxxService> service = new ServiceConfig<XxxService>(); //
此实例很重,封装了与注册中心的连接,请自行缓存,否则可能造成内存和连接泄漏
+service.setApplication(application);
+service.setRegistry(registry); // 多个注册中心可以用setRegistries()
+service.setProtocol(protocol); // 多个协议可以用setProtocols()
+service.setInterface(XxxService.class);
+service.setRef(xxxService);
+service.setVersion("1.0.0");
+
+// 暴露及注册服务
+service.export();
+```
+
+## 服务消费者
+
+```java
+import org.apache.dubbo.rpc.config.ApplicationConfig;
+import org.apache.dubbo.rpc.config.RegistryConfig;
+import org.apache.dubbo.rpc.config.ConsumerConfig;
+import org.apache.dubbo.rpc.config.ReferenceConfig;
+import com.xxx.XxxService;
+
+// 当前应用配置
+ApplicationConfig application = new ApplicationConfig();
+application.setName("yyy");
+
+// 连接注册中心配置
+RegistryConfig registry = new RegistryConfig();
+registry.setAddress("10.20.130.230:9090");
+registry.setUsername("aaa");
+registry.setPassword("bbb");
+
+// 注意:ReferenceConfig为重对象,内部封装了与注册中心的连接,以及与服务提供方的连接
+
+// 引用远程服务
+ReferenceConfig<XxxService> reference = new ReferenceConfig<XxxService>(); //
此实例很重,封装了与注册中心的连接以及与提供者的连接,请自行缓存,否则可能造成内存和连接泄漏
+reference.setApplication(application);
+reference.setRegistry(registry); // 多个注册中心可以用setRegistries()
+reference.setInterface(XxxService.class);
+reference.setVersion("1.0.0");
+
+// 和本地bean一样使用xxxService
+XxxService xxxService = reference.get(); // 注意:此代理对象内部封装了所有通讯细节,对象较重,请缓存复用
+```
+
+## 特殊场景
+
+下面只列出不同的地方,其它参见上面的写法
+
+### 方法级设置
+
+```java
+...
+
+// 方法级配置
+List<MethodConfig> methods = new ArrayList<MethodConfig>();
+MethodConfig method = new MethodConfig();
+method.setName("createXxx");
+method.setTimeout(10000);
+method.setRetries(0);
+methods.add(method);
+
+// 引用远程服务
+ReferenceConfig<XxxService> reference = new ReferenceConfig<XxxService>(); //
此实例很重,封装了与注册中心的连接以及与提供者的连接,请自行缓存,否则可能造成内存和连接泄漏
+...
+reference.setMethods(methods); // 设置方法级配置
+
+...
+```
+
+### 点对点直连
+
+```java
+
+...
+
+ReferenceConfig<XxxService> reference = new ReferenceConfig<XxxService>(); //
此实例很重,封装了与注册中心的连接以及与提供者的连接,请自行缓存,否则可能造成内存和连接泄漏
+// 如果点对点直连,可以用reference.setUrl()指定目标地址,设置url后将绕过注册中心,
+// 其中,协议对应provider.setProtocol()的值,端口对应provider.setPort()的值,
+// 路径对应service.setPath()的值,如果未设置path,缺省path为接口名
+reference.setUrl("dubbo://10.20.130.230:20880/com.xxx.XxxService");
+
+...
+```
+
+[^1]: API使用范围说明:API 仅用于 OpenAPI, ESB, Test, Mock 等系统集成,普通服务提供方或消费方,请采用[XML
配置](../xml)方式使用 Dubbo
diff --git a/content/zh/docs/v3.0/languages/java/configuration/config-center.md
b/content/zh/docs/v3.0/languages/java/configuration/config-center.md
new file mode 100644
index 0000000..2e6e346
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/configuration/config-center.md
@@ -0,0 +1,149 @@
+---
+type: docs
+title: "动态配置中心"
+linkTitle: "动态配置中心"
+weight: 2
+description: "Dubbo 2.7 中的动态配置中心"
+---
+
+配置中心(v2.7.0)在 Dubbo 中承担两个职责:
+
+1. 外部化配置。启动配置的集中式存储 (简单理解为 dubbo.properties 的外部化存储)。
+2. 服务治理。服务治理规则的存储与通知。
+
+启用动态配置,以 Zookeeper 为例,可查看 [动态配置配置项详解](../../references/xml/dubbo-config-center)
+
+```xml
+<dubbo:config-center address="zookeeper://127.0.0.1:2181"/>
+```
+
+或者
+
+```properties
+dubbo.config-center.address=zookeeper://127.0.0.1:2181
+```
+
+或者
+
+```java
+ConfigCenterConfig configCenter = new ConfigCenterConfig();
+configCenter.setAddress("zookeeper://127.0.0.1:2181");
+```
+
+> 为了兼容 2.6.x 版本配置,在使用 Zookeeper 作为注册中心,且没有显示配置配置中心的情况下,Dubbo 框架会默认将此 Zookeeper
用作配置中心,但将只作服务治理用途。
+
+## 外部化配置
+
+外部化配置目的之一是实现配置的集中式管理,这部分业界已经有很多成熟的专业配置系统如 Apollo, Nacos 等,Dubbo
所做的主要是保证能配合这些系统正常工作。
+
+外部化配置和其他本地配置在内容和格式上并无区别,可以简单理解为 `dubbo.properties`
的外部化存储,配置中心更适合将一些公共配置如注册中心、元数据中心配置等抽取以便做集中管理。
+
+```properties
+# 将注册中心地址、元数据中心地址等配置集中管理,可以做到统一环境、减少开发侧感知。
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+dubbo.registry.simplified=true
+
+dubbo.metadata-report.address=zookeeper://127.0.0.1:2181
+
+dubbo.protocol.name=dubbo
+dubbo.protocol.port=20880
+
+dubbo.application.qos.port=33333
+```
+
+- 优先级
+
+ 外部化配置默认较本地配置有更高的优先级,因此这里配置的内容会覆盖本地配置值,关于
[各配置形式间的覆盖关系](../configuration-load-process) 有单独一章说明,你也可通过以下选项调整配置中心的优先级:
+
+ ```properties
+ -Ddubbo.config-center.highest-priority=false
+ ```
+
+- 作用域
+
+
外部化配置有全局和应用两个级别,全局配置是所有应用共享的,应用级配置是由每个应用自己维护且只对自身可见的。当前已支持的扩展实现有Zookeeper、Apollo。
+
+
+#### Zookeeper
+
+```xml
+<dubbo:config-center address="zookeeper://127.0.0.1:2181"/>
+```
+
+默认所有的配置都存储在 `/dubbo/config` 节点,具体节点结构图如下:
+
+
+
+- namespace,用于不同配置的环境隔离。
+- config,Dubbo约定的固定节点,不可更改,所有配置和服务治理规则都存储在此节点下。
+- dubbo/application,分别用来隔离全局配置、应用级别配置:dubbo是默认group值,application对应应用名
+- dubbo.properties,此节点的node value存储具体配置内容
+
+
+
+#### Apollo
+
+```xml
+<dubbo:config-center protocol="apollo" address="127.0.0.1:2181"/>
+```
+
+Apollo中的一个核心概念是命名空间 -
namespace(和上面zookeeper的namespace概念不同),在这里全局和应用级别配置就是通过命名空间来区分的。
+
+默认情况下,Dubbo会从名叫`dubbo`(由于 Apollo 不支持特殊后缀 `.properties`
)的命名空间中读取全局配置(`<dubbo:config-center namespace="your namespace">`)
+
+
+
+由于 Apollo 也默认将会在 `dubbo` namespace 中存储服务治理规则(如路由规则),建议通过单独配置 `group`
将服务治理和配置文件托管分离开,以 XML 配置方式为例:
+```xml
+<dubbo namespace="governance" group ="dubbo"/>
+```
+这里,服务治理规则将存储在 governance namespace,而配置文件将存储在 dubbo namespace,如下图所示:
+
+
+> 关于文件配置托管,相当于是把 `dubbo.properties` 配置文件的内容存储在了 Apollo 中,应用通过关联共享的 `dubbo`
namespace 继承公共配置,
+> 应用也可以按照 Apollo 的做法来覆盖个别配置项。
+
+
+#### 自己加载外部化配置
+
+所谓 Dubbo 对配置中心的支持,本质上就是把 `.properties` 从远程拉取到本地,然后和本地的配置做一次融合。理论上只要 Dubbo
框架能拿到需要的配置就可以正常的启动,它并不关心这些配置是自己加载到的还是应用直接塞给它的,所以Dubbo还提供了以下API,让用户将自己组织好的配置塞给
Dubbo 框架(配置加载的过程是用户要完成的),这样 Dubbo 框架就不再直接和 Apollo 或 Zookeeper 做读取配置交互。
+
+```java
+// 应用自行加载配置
+Map<String, String> dubboConfigurations = new HashMap<>();
+dubboConfigurations.put("dubbo.registry.address",
"zookeeper://127.0.0.1:2181");
+dubboConfigurations.put("dubbo.registry.simplified", "true");
+
+//将组织好的配置塞给Dubbo框架
+ConfigCenterConfig configCenter = new ConfigCenterConfig();
+configCenter.setExternalConfig(dubboConfigurations);
+```
+
+
+
+## 服务治理
+
+#### Zookeeper
+
+默认节点结构:
+
+
+
+- namespace,用于不同配置的环境隔离。
+- config,Dubbo 约定的固定节点,不可更改,所有配置和服务治理规则都存储在此节点下。
+- dubbo,所有服务治理规则都是全局性的,dubbo 为默认节点
+- configurators/tag-router/condition-router,不同的服务治理规则类型,node value 存储具体规则内容
+
+
+
+#### Apollo
+
+所有的服务治理规则都是全局性的,默认从公共命名空间 `dubbo` 读取和订阅:
+
+
+
+不同的规则以不同的 key 后缀区分:
+
+- configurators,[覆盖规则](../../examples/config-rule)
+- tag-router,[标签路由](../../examples/routing-rule)
+- condition-router,[条件路由](../../examples/routing-rule)
\ No newline at end of file
diff --git a/content/zh/docs/v3.0/languages/java/configuration/properties.md
b/content/zh/docs/v3.0/languages/java/configuration/properties.md
new file mode 100644
index 0000000..1d5da56
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/configuration/properties.md
@@ -0,0 +1,44 @@
+---
+type: docs
+title: "属性配置"
+linkTitle: "属性配置"
+weight: 2
+description: "以属性配置的方式来配置你的 Dubbo 应用"
+---
+
+如果你的应用足够简单,例如,不需要多注册中心或多协议,并且需要在spring容器中共享配置,那么,我们可以直接使用 `dubbo.properties`
作为默认配置。
+
+Dubbo 可以自动加载 classpath 根目录下的 dubbo.properties,但是你同样可以使用 JVM
参数来指定路径:`-Ddubbo.properties.file=xxx.properties`。
+
+# 映射规则
+
+可以将 xml 的 tag 名和属性名组合起来,用 ‘.’ 分隔。每行一个属性。
+
+* `dubbo.application.name=foo` 相当于 `<dubbo:application name="foo" />`
+* `dubbo.registry.address=10.20.153.10:9090` 相当于 `<dubbo:registry
address="10.20.153.10:9090" /> `
+
+如果在 xml 配置中有超过一个的 tag,那么你可以使用 ‘id’ 进行区分。如果你不指定 id,它将作用于所有 tag。
+
+* `dubbo.protocol.rmi.port=1099` 相当于 `<dubbo:protocol id="rmi" name="rmi"
port="1099" /> `
+* `dubbo.registry.china.address=10.20.153.10:9090` 相当于 `<dubbo:registry
id="china" address="10.20.153.10:9090" />`
+
+如下,是一个典型的 dubbo.properties 配置样例。
+
+```properties
+dubbo.application.name=foo
+dubbo.application.owner=bar
+dubbo.registry.address=10.20.153.10:9090
+```
+
+## 重写与优先级
+
+
+
+优先级从高到低:
+
+* JVM -D 参数:当你部署或者启动应用时,它可以轻易地重写配置,比如,改变 dubbo 协议端口;
+* XML:XML 中的当前配置会重写 dubbo.properties 中的;
+* Properties:默认配置,仅仅作用于以上两者没有配置时。
+
+1. 如果在 classpath 下有超过一个 dubbo.properties 文件,比如,两个 jar 包都各自包含了
dubbo.properties,dubbo 将随机选择一个加载,并且打印错误日志。
+2. 如果 `id` 没有在 `protocol` 中配置,将使用 `name` 作为默认属性。
diff --git a/content/zh/docs/v3.0/languages/java/configuration/xml.md
b/content/zh/docs/v3.0/languages/java/configuration/xml.md
new file mode 100644
index 0000000..e2bbbe8
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/configuration/xml.md
@@ -0,0 +1,98 @@
+---
+type: docs
+title: "XML 配置"
+linkTitle: "XML 配置"
+weight: 1
+description: "以 XML 配置的方式来配置你的 Dubbo 应用"
+---
+
+有关 XML 的详细配置项,请参见:[配置参考手册](../../references/xml)。如果不想使用 Spring 配置,而希望通过 API
的方式进行调用,请参见:[API配置](../api)。想知道如何使用配置,请参见:[快速启动](../../quick-start)。
+
+请在此查看文档描述的[完整示例](https://github.com/apache/dubbo-samples/tree/master/java/dubbo-samples-basic)
+
+## provider.xml 示例
+
+```xml
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
+ xmlns="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://dubbo.apache.org/schema/dubbo
http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
+ <dubbo:application name="demo-provider"/>
+ <dubbo:registry address="zookeeper://127.0.0.1:2181"/>
+ <dubbo:protocol name="dubbo" port="20890"/>
+ <bean id="demoService"
class="org.apache.dubbo.samples.basic.impl.DemoServiceImpl"/>
+ <dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService"
ref="demoService"/>
+</beans>
+```
+
+## consumer.xml示例
+
+```xml
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
+ xmlns="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://dubbo.apache.org/schema/dubbo
http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
+ <dubbo:application name="demo-consumer"/>
+ <dubbo:registry group="aaa" address="zookeeper://127.0.0.1:2181"/>
+ <dubbo:reference id="demoService" check="false"
interface="org.apache.dubbo.samples.basic.api.DemoService"/>
+</beans>
+```
+
+所有标签都支持自定义参数,用于不同扩展点实现的特殊配置,如:
+
+```xml
+<dubbo:protocol name="jms">
+ <dubbo:parameter key="queue" value="your_queue" />
+</dubbo:protocol>
+```
+
+或: [^1]
+
+```xml
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
+ xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://dubbo.apache.org/schema/dubbo
http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
+ <dubbo:protocol name="jms" p:queue="your_queue" />
+</beans>
+```
+
+## 配置之间的关系
+
+
+
+标签 | 用途 | 解释
+------------- | ------------- | -------------
+`<dubbo:service/>` | 服务配置 | 用于暴露一个服务,定义服务的元信息,一个服务可以用多个协议暴露,一个服务也可以注册到多个注册中心
+`<dubbo:reference/>` [^2] | 引用配置 | 用于创建一个远程服务代理,一个引用可以指向多个注册中心
+`<dubbo:protocol/>` | 协议配置 | 用于配置提供服务的协议信息,协议由提供方指定,消费方被动接受
+`<dubbo:application/>` | 应用配置 | 用于配置当前应用信息,不管该应用是提供者还是消费者
+`<dubbo:module/>` | 模块配置 | 用于配置当前模块信息,可选
+`<dubbo:registry/>` | 注册中心配置 | 用于配置连接注册中心相关信息
+`<dubbo:monitor/>` | 监控中心配置 | 用于配置连接监控中心相关信息,可选
+`<dubbo:provider/>` | 提供方配置 | 当 ProtocolConfig 和 ServiceConfig
某属性没有配置时,采用此缺省值,可选
+`<dubbo:consumer/>` | 消费方配置 | 当 ReferenceConfig 某属性没有配置时,采用此缺省值,可选
+`<dubbo:method/>` | 方法配置 | 用于 ServiceConfig 和 ReferenceConfig 指定方法级的配置信息
+`<dubbo:argument/>` | 参数配置 | 用于指定方法参数配置
+
+
+## 不同粒度配置的覆盖关系
+
+以 timeout 为例,下图显示了配置的查找顺序,其它 retries, loadbalance, actives 等类似:
+
+* 方法级优先,接口级次之,全局配置再次之。
+* 如果级别一样,则消费方优先,提供方次之。
+
+其中,服务提供方配置,通过 URL 经由注册中心传递给消费方。
+
+
+
+(建议由服务提供方设置超时,因为一个方法需要执行多长时间,服务提供方更清楚,如果一个消费方同时引用多个服务,就不需要关心每个服务的超时设置)。
+
+理论上 ReferenceConfig
中除了`interface`这一项,其他所有配置项都可以缺省不配置,框架会自动使用ConsumerConfig,ServiceConfig,
ProviderConfig等提供的缺省配置。
+
+[^1]: `2.1.0` 开始支持,注意声明:`xmlns:p="http://www.springframework.org/schema/p"`
+[^2]: 引用缺省是延迟初始化的,只有引用被注入到其它 Bean,或被 `getBean()`
获取,才会初始化。如果需要饥饿加载,即没有人引用也立即生成动态代理,可以配置:`<dubbo:reference ... init="true" />`
diff --git a/content/zh/docs/v3.0/languages/java/java-specific.md
b/content/zh/docs/v3.0/languages/java/java-specific.md
new file mode 100644
index 0000000..7f776e0
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/java-specific.md
@@ -0,0 +1,107 @@
+---
+type: docs
+title: "Java 语言定义服务"
+linkTitle: "Java 定义服务"
+weight: 10
+description: ""
+---
+
+示例使用 Spring XML 配置方式进行演示。
+
+除此之外,Dubbo Java 还提供了包括注解、API、配置文件、spring boot等多种启动与接入方式,具体可参见配置章节具体描述。
+
+## 下载示例代码
+示例代码在 [dubbo-samples](https://github.com/apache/dubbo-samples) 中
+1. 下载源码
+```shell script
+$ git clone -b master https://github.com/apache/dubbo-samples.git
+```
+2. 进入示例目录
+```shell script
+$ cd dubbo-samples/dubbo-samples-basic
+```
+
+## 快速运行示例
+在 dubbo-samples-basic 目录
+
+1. 编译 Provider
+```shell script
+$ mvn clean compile -Pprovider
+```
+
+2. 运行 Provider
+```shell script
+$ java -jar ./target/provider.jar
+```
+
+3. 编译 Consumer
+```shell script
+$ mvn clean compile -Pconsumer
+```
+
+4. 运行 consumer
+```shell script
+$ java -jar ./target/consumer.jar
+```
+
+## 详细解释
+
+### 定义服务接口
+
+DemoService.java
+
+```java
+package org.apache.dubbo.samples.basic.api;
+
+public interface DemoService {
+ String sayHello(String name);
+}
+```
+
+### 在服务提供方实现接口
+
+DemoServiceImpl.java
+
+```java
+public class DemoServiceImpl implements DemoService {
+ @Override
+ public String sayHello(String name) {
+ System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new
Date()) + "] Hello " + name +
+ ", request from consumer: " +
RpcContext.getContext().getRemoteAddress());
+ return "Hello " + name + ", response from provider: " +
RpcContext.getContext().getLocalAddress();
+ }
+}
+```
+
+### 用 Spring 配置声明暴露服务
+
+provider.xml:
+
+```xml
+<bean id="demoService"
class="org.apache.dubbo.samples.basic.impl.DemoServiceImpl"/>
+
+<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService"
ref="demoService"/>
+```
+
+## 服务消费者
+
+### 引用远程服务
+
+consumer.xml:
+
+```xml
+<dubbo:reference id="demoService" check="true"
interface="org.apache.dubbo.samples.basic.api.DemoService"/>
+```
+
+### 加载Spring配置,并调用远程服务
+
+Consumer.java
+
+```java
+public static void main(String[] args) {
+ ...
+ DemoService demoService = (DemoService) context.getBean("demoService");
+ String hello = demoService.sayHello("world");
+ System.out.println(hello);
+}
+```
\ No newline at end of file
diff --git a/content/zh/docs/v3.0/languages/java/quick-start.md
b/content/zh/docs/v3.0/languages/java/quick-start.md
new file mode 100644
index 0000000..6876d65
--- /dev/null
+++ b/content/zh/docs/v3.0/languages/java/quick-start.md
@@ -0,0 +1,188 @@
+---
+type: docs
+title: "Java 快速开始"
+linkTitle: "Java 快速开始"
+weight: 10
+description: ""
+---
+
+## 下载示例代码
+示例代码在 [dubbo-samples](https://github.com/apache/dubbo-samples) 中
+1. 下载源码
+```shell script
+$ git clone -b master https://github.com/apache/dubbo-samples.git
+```
+2. 进入示例目录
+```shell script
+$ cd dubbo-samples/dubbo-samples-protobuf
+```
+
+## 快速运行示例
+在 dubbo-samples-protobuf 目录
+
+1. 编译示例项目
+```shell script
+$ mvn clean compile
+```
+
+2. 运行 Provider
+```shell script
+$ java -jar
./dubbo-samples-protobuf/protobuf-provider/target/protobuf-provider-1.0-SNAPSHOT.jar
+```
+
+3. 运行 consumer
+```shell script
+$ java -jar
./dubbo-samples-protobuf/protobuf-provider/target/protobuf-consumer-1.0-SNAPSHOT.jar
+
+输出以下结果
+result: Hello Hello, response from provider: 30.225.20.43:20880
+```
+
+
+以上就是一个简单的 Dubbo 服务定义、服务调用流程
+
+## 详细讲解
+1. 服务定义
+```text
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.dubbo.demo";
+option java_outer_classname = "DemoServiceProto";
+option objc_class_prefix = "DEMOSRV";
+
+package demoservice;
+
+// The demo service definition.
+service DemoService {
+ rpc SayHello (HelloRequest) returns (HelloReply) {}
+}
+
+// The request message containing the user's name.
+message HelloRequest {
+ string name = 1;
+}
+
+// The response message containing the greetings
+message HelloReply {
+ string message = 1;
+}
+
+```
+
+2. Protobuf Compiler 插件配置
+```xml
+<plugin>
+ <groupId>org.xolstice.maven.plugins</groupId>
+ <artifactId>protobuf-maven-plugin</artifactId>
+ <version>0.5.1</version>
+ <configuration>
+
<protocArtifact>com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier}</protocArtifact>
+
<outputDirectory>build/generated/source/proto/main/java</outputDirectory>
+ <clearOutputDirectory>false</clearOutputDirectory>
+ <protocPlugins>
+ <protocPlugin>
+ <id>dubbo</id>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-compiler</artifactId>
+ <version>${dubbo.compiler.version}</version>
+
<mainClass>org.apache.dubbo.gen.dubbo.Dubbo3Generator</mainClass>
+ </protocPlugin>
+ </protocPlugins>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>test-compile</goal>
+ </goals>
+ </execution>
+ </executions>
+</plugin>
+```
+
+3. 编译与stub
+运行 mvn clean compile 后
+
+生成代码路径
+`dubbo-samples-protobuf/protobuf-provider/build/generated/source/proto/main/java/org/apache/dubbo/demo`
+
+生成文件列表
+```text
+.
+├── DemoService.java
+├── DemoServiceDubbo.java
+├── DemoServiceProto.java
+├── HelloReply.java
+├── HelloReplyOrBuilder.java
+├── HelloRequest.java
+└── HelloRequestOrBuilder.java
+```
+
+DemoService.java 定义如下
+```java
[email protected](
+value = "by Dubbo generator",
+comments = "Source: DemoService.proto")
+public interface DemoService {
+ static final String JAVA_SERVICE_NAME =
"org.apache.dubbo.demo.DemoService";
+ static final String SERVICE_NAME = "demoservice.DemoService";
+
+ static final boolean inited = DemoServiceDubbo.init();
+
+ org.apache.dubbo.demo.HelloReply
sayHello(org.apache.dubbo.demo.HelloRequest request);
+
+ CompletableFuture<org.apache.dubbo.demo.HelloReply>
sayHelloAsync(org.apache.dubbo.demo.HelloRequest request);
+}
+```
+
+4. 发布服务
+```java
+public class DemoServiceImpl implements DemoService {
+ private static final Logger logger =
LoggerFactory.getLogger(DemoServiceImpl.class);
+
+ @Override
+ public HelloReply sayHello(HelloRequest request) {
+ logger.info("Hello " + request.getName() + ", request from consumer: "
+ RpcContext.getContext().getRemoteAddress());
+ return HelloReply.newBuilder()
+ .setMessage("Hello " + request.getName() + ", response from
provider: "
+ + RpcContext.getContext().getLocalAddress())
+ .build();
+ }
+
+ @Override
+ public CompletableFuture<HelloReply> sayHelloAsync(HelloRequest request) {
+ return CompletableFuture.completedFuture(sayHello(request));
+ }
+}
+```
+
+```xml
+<bean id="demoServiceImpl"
class="org.apache.dubbo.demo.provider.DemoServiceImpl"/>
+
+<dubbo:service serialization="protobuf"
interface="org.apache.dubbo.demo.DemoService"
+ ref="demoServiceImpl"/>
+```
+
+5. 使用服务
+
+```xml
+<dubbo:reference scope="remote" id="demoService" check="false"
interface="org.apache.dubbo.demo.DemoService"/>
+```
+
+```java
+public class ConsumerApplication {
+ public static void main(String[] args) throws Exception {
+ ClassPathXmlApplicationContext context = new
ClassPathXmlApplicationContext("spring/dubbo-consumer.xml");
+ context.start();
+ DemoService demoService = context.getBean("demoService",
DemoService.class);
+ HelloRequest request =
HelloRequest.newBuilder().setName("Hello").build();
+ HelloReply reply = demoService.sayHello(request);
+ System.out.println("result: " + reply.getMessage());
+ System.in.read();
+ }
+}
+```
+
+## 其他
+示例运行过程中还用到了服务发现等机制,详情请参见相关章节说明
\ No newline at end of file
diff --git a/content/zh/docs/v3.0/new-in-dubbo3.md
b/content/zh/docs/v3.0/new-in-dubbo3.md
index 6885d5f..79bd4d4 100644
--- a/content/zh/docs/v3.0/new-in-dubbo3.md
+++ b/content/zh/docs/v3.0/new-in-dubbo3.md
@@ -3,8 +3,102 @@ type: docs
title: "What's New in Dubbo3"
linkTitle: "新版本特性速览"
weight: 2
-description: "Dubbo3 对比之前版本的变化。"
+description: "Dubbo3 相比 2.7 版本进行了全面的升级,以下是新增的一些核心特性"
---
+## 全新服务发现模型
+相比于 2.x 版本中的基于`接口`粒度的服务发现机制,3.x
引入了全新的[基于应用粒度的服务发现机制](../concepts/service-discovery),
+新模型带来两方面的巨大优势:
+* 进一步提升了 Dubbo3 在大规模集群实践中的性能与稳定性。新模型可大幅提高系统资源利用率,降低 Dubbo
地址的单机内存消耗(50%),降低注册中心集群的存储与推送压力(90%),
+Dubbo 可支持集群规模步入百万实例层次。
+* 打通与其他异构微服务体系的地址互发现障碍。新模型使得 Dubbo3 能实现与异构微服务体系如Spring Cloud、Kubernetes
Service、gRPC 等,在地址发现层面的互通,
+为连通 Dubbo 与其他微服务体系提供可行方案。
+在 Dubbo3 前期版本将会同时提供对两套地址发现模型的支持,以最大程度保证业务升级的兼容性。
+## 下一代 RPC 通信协议
+定义了全新的 RPC 通信协议 -- Triple,一句话概括 Triple:它是基于 HTTP/2 上构建的 RPC 协议,完全兼容
gRPC,并在此基础上扩展出了更丰富的语义。
+使用 Triple 协议,用户将获得以下能力
+* 更容易到适配网关、Mesh架构,Triple 协议让 Dubbo 更方便的与各种网关、Sidecar 组件配合工作。
+* 多语言友好,推荐配合 Protobuf 使用 Triple 协议,使用 IDL 定义服务,使用 Protobuf 编码业务数据。
+* 流式通信支持。Triple 协议支持 Request Stream、Response Stream、Bi-direction Stream
+
+## 云原生
+Dubbo3 构建的业务应用可直接部署在 VM、Container、Kubernetes 等平台,Dubbo3 很好的解决了 Dubbo
服务与调度平台之间的声明周期对齐,Dubbo 服务发现地址
+与容器平台绑定的问题。
+
+在服务发现层面,Dubbo3 支持与 [Kubernetes Native Service]() 的融合,目前限于 Headless Service。
+
+Dubbo3 规划了两种形态的 Service Mesh 方案,在不同的业务场景、不同的迁移阶段、不同的基础设施保障情况下,Dubbo 都会有 Mesh
方案可供选择,
+而这进一步的都可以通过统一的控制面进行治理。
+* 经典的基于 Sidecar 的 Service Mesh
+* 无 Sidecar 的 Proxyless Mesh
+
+用户在 Dubbo2 中熟知的路由规则,在 3.x 中将被一套[`统一的流量治理规则`]()取代,这套统一流量规则将覆盖未来 Dubbo3 的
Service Mesh、SDK 等多种部署形态,
+实现对整套微服务体系的治理。
+
+## 扩展点分离
+Dubbo3 的 maven 也发生了一些变化,`org.apache.dubbo:dubbo:3.0.0` 将不再是包含所有资源的 all-in-one
包,一些可选的依赖已经作为独立组件单独发布,
+因此如果用户使用了不在 `dubbo` 核心依赖包中的独立组件,如 registry-etcd、rpc-hessian 等,需要为这些组件在 pom.xml
中单独增加依赖包。
+
+Zookeeper 扩展实现仍在核心依赖包中,依赖保持不变
+```xml
+<properties>
+ <dubbo.version>3.0.0</dubbo.version>
+</properties>
+<dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-dependencies-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ </dependency>
+</dependencies>
+```
+
+Redis 扩展实现已经不在核心依赖包中,如启用了 Redis 相关功能,需单独增加依赖包
+```xml
+<properties>
+ <dubbo.version>3.0.0</dubbo.version>
+</properties>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-dependencies-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-redis</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+</dependencies>
+```
+
+> 详情请参见扩展点实现列表
+
+## 服务柔性
+> 尚未发布
+
+Dubbo3.0 的柔性增强以面向失败设计为理念,提供包括精准容量评估、自适应限流、自适应负载均衡的支持,自底向上的分步构建大规模可靠应用。
+从单一服务的视角看,服务是压不垮的,稳定的。从分布式视角看,复杂的拓扑不会带来性能的下降,分布式负载均衡能够以最优的方式动态分配流量,保证异构系统能够根据运行时的准确服务容量合理分配请求,从而达到性能最优。
+
+## 全面的性能提升
+> 更多官方压测数据
+
+
+## Native Image
+> 尚未发布
\ No newline at end of file
diff --git a/content/zh/docs/v3.0/references/protobuf/_index.md
b/content/zh/docs/v3.0/references/protobuf/_index.md
new file mode 100644
index 0000000..6831b1b
--- /dev/null
+++ b/content/zh/docs/v3.0/references/protobuf/_index.md
@@ -0,0 +1,7 @@
+---
+type: docs
+title: "Protobuf"
+linkTitle: "protobuf"
+weight: 1
+description: "Dubbo 的 Protobuf 支持"
+---
\ No newline at end of file
diff --git a/content/zh/docs/v3.0/references/protobuf/idl.md
b/content/zh/docs/v3.0/references/protobuf/idl.md
new file mode 100644
index 0000000..2c7c131
--- /dev/null
+++ b/content/zh/docs/v3.0/references/protobuf/idl.md
@@ -0,0 +1,12 @@
+---
+type: docs
+title: "使用 IDL 开发服务"
+linkTitle: "idl"
+weight: 11
+description: "使用 IDL 开发服务"
+---
+
+## 定义服务
+
+
+## 插件支持