This is an automated email from the ASF dual-hosted git repository. mercyblitz pushed a commit to branch 0.1.1 in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-spring-boot-project.git
The following commit(s) were added to refs/heads/0.1.1 by this push: new 9032ec7 Polish #50 9032ec7 is described below commit 9032ec78178a2adebde348019bc89a07501ba342 Author: mercyblitz <mercybl...@gmail.com> AuthorDate: Thu Mar 29 17:41:31 2018 +0800 Polish #50 --- README.md | 38 ++- README_CN.md | 292 +++++++++++++++++++++ dubbo-spring-boot-actuator/README.md | 7 - .../{README.md => README_CN.md} | 98 ++++--- .../boot/dubbo/actuate/endpoint/DubboEndpoint.java | 8 - .../controller/DemoConsumerController.java | 2 +- .../src/main/resources/application.properties | 3 + .../demo/provider/service/DefaultDemoService.java | 2 +- .../src/main/resources/application.properties | 3 + 9 files changed, 378 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 2b8af73..8b3fee4 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,31 @@ For now, `dubbo-spring-boot-starter` will separate two versions for Spring Boot ## Integrate with Maven -You can introduce the latest `dubbo-spring-boot-starter` to your project by adding the following dependency to your pom.xml +You can introduce the latest `dubbo-spring-boot-project` to your project by adding the following dependency to your pom.xml ```xml -<dependency> - <groupId>com.alibaba.boot</groupId> - <artifactId>dubbo-spring-boot-starter</artifactId> - <version>0.1.1</version> -</dependency> +<dependencies> + + ... + + <!-- Core Features --> + <dependency> + <groupId>com.alibaba.boot</groupId> + <artifactId>dubbo-spring-boot-starter</artifactId> + <version>0.1.1</version> + </dependency> + + <!-- Production-Ready Features --> + <dependency> + <groupId>com.alibaba.boot</groupId> + <artifactId>dubbo-spring-boot-actuator</artifactId> + <version>0.1.1</version> + </dependency> + + ... + +</dependencies> ``` + If your project failed to resolve the dependency, try to add the following repository: ```xml <repositories> @@ -82,7 +99,7 @@ Service Provider implements `DemoService` : ```java @Service( - version = "1.0.0", + version = "${demo.service.version}", application = "${dubbo.application.id}", protocol = "${dubbo.protocol.id}", registry = "${dubbo.registry.id}" @@ -123,6 +140,9 @@ spring.application.name = dubbo-provider-demo server.port = 9090 management.port = 9091 +# Service version +demo.service.version = 1.0.0 + # Base packages to scan Dubbo Components (e.g @Service , @Reference) dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service @@ -161,7 +181,7 @@ Service consumer requires Spring Beans to reference `DemoService` : @RestController public class DemoConsumerController { - @Reference(version = "1.0.0", + @Reference(version = "${demo.service.version}", application = "${dubbo.application.id}", url = "dubbo://localhost:12345") private DemoService demoService; @@ -201,6 +221,8 @@ spring.application.name = dubbo-consumer-demo server.port = 8080 management.port = 8081 +# Service version +demo.service.version = 1.0.0 # Dubbo Config properties ## ApplicationConfig Bean diff --git a/README_CN.md b/README_CN.md new file mode 100644 index 0000000..9cb439e --- /dev/null +++ b/README_CN.md @@ -0,0 +1,292 @@ +# Dubbo Spring Boot 工程 + +[Dubbo](https://github.com/alibaba/dubbo) Spring Boot 工程致力于简化 Dubbo RPC 框架在 +[Spring Boot](https://github.com/spring-projects/spring-boot/) 应用场景的开发。同时也整合了 Spring Boot 特性: + +* [自动装配](dubbo-spring-boot-autoconfigure) (比如: 注解驱动, 自动装配等). +* [Production-Ready](dubbo-spring-boot-actuator) (比如: 安全, 健康检查, 外部化配置等). + + + +> Dubbo *|ˈdʌbəʊ|* is a high-performance, java based [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) framework open-sourced by Alibaba. As in many RPC systems, dubbo is based around the idea of defining a service, specifying the methods that can be called remotely with their parameters and return types. On the server side, the server implements this interface and runs a dubbo server to handle client calls. On the client side, the client has a stub that provides the same method [...] + + + +## 版本 + +从现在开始, `dubbo-spring-boot-project` 将在每个发布中发行两个版本 : + +* `0.2.x` 是支持 Spring Boot 2.x 的主要版本(推荐,长期维护) + +* `0.1.x` 是支持 Spring Boot 1.x 的维护版本(兼容,短期维护) + + +## Maven 整合 + +### 稳定版本 + +如果你希望使用稳定的 `dubbo-spring-boot-project`,您可以自行将以下 Maven 依赖添加到您的工程 pom.xml: + +```xml +<dependencies> + + ... + + <!-- 功能特性 --> + <dependency> + <groupId>com.alibaba.boot</groupId> + <artifactId>dubbo-spring-boot-starter</artifactId> + <version>0.1.1</version> + </dependency> + + <!-- Production-Ready 特性 --> + <dependency> + <groupId>com.alibaba.boot</groupId> + <artifactId>dubbo-spring-boot-actuator</artifactId> + <version>0.1.1</version> + </dependency> + + ... + +</dependencies> +``` + + +### 开发版本 + +如果你需要尝试最新 `dubbo-spring-boot-project` 的特性,您可以自将[开发分支](tree/0.1.x) 手动 Maven install 到本地 Maven 仓库。 + + + +## 依赖关系 + +| 版本 | Java | Spring Boot | Dubbo | +| -------- | ----- | ----------------- | ---------- | +| `0.2.0` | 1.8 + | `2.0.0.RELEASE` + | `2.5.11` + | +| `0.1.1` | 1.7 + | `1.5.10.RELEASE` + | `2.5.11` + | + + + +## 快速开始 + +如果您对 Dubbo 不是非常了解,耽误您几分钟访问 http://dubbo.io/。了解后,如果你期望更深入的探讨,可以移步[用户手册](http://dubbo.io/books/dubbo-user-book/)。 + +通常情况 , Dubbo 应用有两种使用场景 , 其一为 Dubbo 服务提供方 , 另外一个是 Dubbo 服务消费方,当然也允许两者混合,下面我们一起快速开始! + +首先,我们假设存在一个 Dubbo RPC API ,由服务提供方为服务消费方暴露接口 : + +```java +public interface DemoService { + + String sayHello(String name); + +} +``` + + + +### 实现 Dubbo 服务提供方 + +1. 实现 `DemoService` 接口 + +```java +@Service( + version = "${demo.service.version}", + application = "${dubbo.application.id}", + protocol = "${dubbo.protocol.id}", + registry = "${dubbo.registry.id}" +) +public class DefaultDemoService implements DemoService { + + public String sayHello(String name) { + return "Hello, " + name + " (from Spring Boot)"; + } + +} +``` + + + +2. 编写 Spring Boot 引导程序 + +```java +@SpringBootApplication +public class DubboProviderDemo { + + public static void main(String[] args) { + + new SpringApplicationBuilder(DubboProviderDemo.class) + .web(false) // 非 Web 应用 + .run(args); + + } + +} +``` + + +3. 配置 `application.properties` : + +```properties +# Spring boot application +spring.application.name = dubbo-provider-demo +server.port = 9090 +management.port = 9091 + +# Service version +demo.service.version = 1.0.0 + +# Base packages to scan Dubbo Components (e.g @Service , @Reference) +dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service + +# Dubbo Config properties +## ApplicationConfig Bean +dubbo.application.id = dubbo-provider-demo +dubbo.application.name = dubbo-provider-demo + +## ProtocolConfig Bean +dubbo.protocol.id = dubbo +dubbo.protocol.name = dubbo +dubbo.protocol.port = 12345 + +## RegistryConfig Bean +dubbo.registry.id = my-registry +dubbo.registry.address = N/A +``` + +更多的实现细节 , 请参考 [Dubbo 服务提供方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider). + + + +### 实现 Dubbo 服务消费方 + + +1. 通过 `@Reference` 注入 `DemoService` : + +```java +@RestController +public class DemoConsumerController { + + @Reference(version = "${demo.service.version}", + application = "${dubbo.application.id}", + url = "dubbo://localhost:12345") + private DemoService demoService; + + @RequestMapping("/sayHello") + public String sayHello(@RequestParam String name) { + return demoService.sayHello(name); + } + +} +``` + + + +2. 编写 Spring Boot 引导程序(Web 应用) : + +```java +@SpringBootApplication(scanBasePackages = "com.alibaba.boot.dubbo.demo.consumer.controller") +public class DubboConsumerDemo { + + public static void main(String[] args) { + + SpringApplication.run(DubboConsumerDemo.class,args); + + } + +} +``` + + + +3. 配置 `application.properties` : + +```properties +# Spring boot application +spring.application.name = dubbo-consumer-demo +server.port = 8080 +management.port = 8081 + +# Service Version +demo.service.version = 1.0.0 + +# Dubbo Config properties +## ApplicationConfig Bean +dubbo.application.id = dubbo-consumer-demo +dubbo.application.name = dubbo-consumer-demo + +## ProtocolConfig Bean +dubbo.protocol.id = dubbo +dubbo.protocol.name = dubbo +dubbo.protocol.port = 12345 +``` + + +请确保 Dubbo 服务提供方服务可用, `DubboProviderDemo` 运行方可正常。 + + +更多的实现细节,请参考 [Dubbo 服务消费方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer) + + + +## 社区交流 + +如果您在使用 Dubbo Spring Boot 中遇到任何问题或者有什么建议? 我们非常需要您的支持! + +- 如果您需要升级版本,请提前阅读[发布公告](https://github.com/dubbo/dubbo-spring-boot-project/releases),了解最新的特性和问题修复。 +- 如果您遇到任何问题 ,您可以加入官方 [Google 讨论组](https://groups.google.com/group/dubbo) , 或者订阅 [Dubbo 用户邮件列表](mailto:dubbo+subscr...@googlegroups.com)。 +- 问题反馈,您可以在 [issues](https://github.com/dubbo/dubbo-spring-boot-project/issues) 提出您遇到的使用问题。 + + + +## 模块工程 + +Dubbo Spring Boot 采用多 Maven 模块工程 , 模块如下: + + + +### [dubbo-spring-boot-parent](dubbo-spring-boot-parent) + +[dubbo-spring-boot-parent](dubbo-spring-boot-parent) 模块主要管理 Dubbo Spring Boot 工程的 Maven 依赖 + +### [dubbo-spring-boot-autoconfigure](dubbo-spring-boot-autoconfigure) + +[dubbo-spring-boot-autoconfigure](dubbo-spring-boot-autoconfigure) 模块提供 Spring Boot's `@EnableAutoConfiguration` 的实现 - `DubboAutoConfiguration`, +它简化了 Dubbo 核心组件的装配。 + + + +### [dubbo-spring-boot-actuator](dubbo-spring-boot-actuator) + +[dubbo-spring-boot-actuator](dubbo-spring-boot-actuator) 提供 Production-Ready 特性: + +* [健康检查](dubbo-spring-boot-actuator#health-checks) +* [控制断点](dubbo-spring-boot-actuator#endpoints) +* [外部化配置](dubbo-spring-boot-actuator#externalized-configuration)) + + +### [dubbo-spring-boot-starter](dubbo-spring-boot-starter) + +[dubbo-spring-boot-starter](dubbo-spring-boot-starter) 模块为标准的 Spring Boot Starter , +当您将它引入到工程后,[dubbo-spring-boot-autoconfigure](dubbo-spring-boot-autoconfigure) 模块会一同被间接依赖。 + + + +### [dubbo-spring-boot-samples](dubbo-spring-boot-samples) + +The samples project of Dubbo Spring Boot that includes two parts: +[dubbo-spring-boot-samples](dubbo-spring-boot-samples) 为 Dubbo Spring Boot 示例工程,包括: + + +#### [Dubbo 服务提供方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider) + +Dubbo 服务将会通过 localhost 的 `12345` 端口暴露服务,并且提供 JMX Endpoints。 + + +#### [Dubbo 服务消费方示例](dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer) + +Dubbo 服务将被 Spring WebMVC `Controller` 消费,并且提供 JMX 以及 Web Endpoints 端口: + +* 示例 `Controller` : http://localhost:8080/sayHello?name=HelloWorld +* [健康检查](dubbo-spring-boot-actuator#health-checks) : http://localhost:8081/health +* [Dubbo Endpoints](dubbo-spring-boot-actuator#endpoints) : http://localhost:8081/dubbo diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README.md index 39d8c41..1a67d86 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README.md @@ -172,13 +172,6 @@ Actuator endpoint `dubbo` supports Spring Web MVC Endpoints : "github": "https://github.com/dubbo/dubbo-spring-boot-project", "issues": "https://github.com/dubbo/dubbo-spring-boot-project/issues", "git": "https://github.com/dubbo/dubbo-spring-boot-project.git" - }, - "endpoints": { - "shutdown": "/shutdown", - "configs": "/configs", - "services": "/services", - "references": "/references", - "properties": "/properties" } } ``` diff --git a/dubbo-spring-boot-actuator/README.md b/dubbo-spring-boot-actuator/README_CN.md similarity index 79% copy from dubbo-spring-boot-actuator/README.md copy to dubbo-spring-boot-actuator/README_CN.md index 39d8c41..2e64003 100644 --- a/dubbo-spring-boot-actuator/README.md +++ b/dubbo-spring-boot-actuator/README_CN.md @@ -1,58 +1,66 @@ # Dubbo Spring Boot Production-Ready -`dubbo-spring-boot-actuator` provides production-ready features (e.g. [health checks](#health-checks), [endpoints](#endpoints), and [externalized configuration](#externalized-configuration)). +`dubbo-spring-boot-actuator` 提供 Production-Ready 特性 (比如 [健康检查](#health-checks), [OPS 端点](#endpoints), and [外部化配置](#externalized-configuration)). -## Content +## 目录 -1. [Main Content](https://github.com/dubbo/dubbo-spring-boot-project) -2. [Integrate with Maven](#integrate-with-maven) -3. [Health Checks](#health-checks) -4. [Endpoints](#endpoints) -5. [Externalized Configuration](#externalized-configuration) +1. [主目录](https://github.com/dubbo/dubbo-spring-boot-project) +2. [Maven 整合](#integrate-with-maven) +3. [健康检查](#health-checks) +4. [OPS 端点](#endpoints) +5. [外部化配置](#externalized-configuration) -## Integrate with Maven +## Maven 整合 + +### 稳定版本 + +`dubbo-spring-boot-actuator` 是可选模块,它不应该独立存在,需要与 `dubbo-spring-boot-starter` 并存方可工作正常。您可以直接增加到 +应用工程的 pom.xml 文件: + -You can introduce the latest `dubbo-spring-boot-actuator` to your project by adding the following dependency to your pom.xml -```xml -<dependency> - <groupId>com.alibaba.boot</groupId> - <artifactId>dubbo-spring-boot-actuator</artifactId> - <version>0.1.1</version> -</dependency> -``` -If your project failed to resolve the dependency, try to add the following repository: ```xml -<repositories> - <repository> - <id>sonatype-nexus-snapshots</id> - <url>https://oss.sonatype.org/content/repositories/snapshots</url> - <releases> - <enabled>false</enabled> - </releases> - <snapshots> - <enabled>true</enabled> - </snapshots> - </repository> -</repositories> -``` +<dependencies> + ... + <!-- 功能特性 --> + <dependency> + <groupId>com.alibaba.boot</groupId> + <artifactId>dubbo-spring-boot-starter</artifactId> + <version>0.1.1</version> + </dependency> -## Health Checks + <!-- Production-Ready 特性 --> + <dependency> + <groupId>com.alibaba.boot</groupId> + <artifactId>dubbo-spring-boot-actuator</artifactId> + <version>0.1.1</version> + </dependency> -`dubbo-spring-boot-actuator` supports the standard Spring Boot `HealthIndicator` as a production-ready feature , which will be aggregated into Spring Boot's `Health` and exported on `HealthEndpoint` that works MVC (Spring Web MVC) and JMX (Java Management Extensions) both if they are available. + ... + +</dependencies> +``` +### 开发版本 +如果你需要尝试最新 `dubbo-spring-boot-actuator` 的特性,您可以自将[开发分支](../tree/0.1.x) 手动 Maven install 到本地 Maven 仓库。 -### MVC Endpoint : `/health` +## 健康检查 +`dubbo-spring-boot-actuator` 实现了标准的 Spring Boot `HealthIndicator` , 它将聚合 Dubbo 相关的健康指标数据到 Spring Boot's `Health` + ,并且 暴露在 `HealthEndpoint` ,它能够在 works MVC (Spring Web MVC) and JMX (Java Management Extensions) both if they are available. -Suppose a Spring Boot Web application did not specify `management.port`, you can access http://localhost:8080/health via Web Client and will get a response with JSON format is like below : + +### Web Endpoint : `/health` + + +假设 Spring Boot Web 应用没有指定 `management.port` 属性, 运行后,通过 Web 客户端访问 http://localhost:8080/health,HTTP 相应将会返回一个 JSON 格式的内容,如下所示: ```json { @@ -96,31 +104,28 @@ Suppose a Spring Boot Web application did not specify `management.port`, you can } ``` -In [samples](../dubbo-spring-boot-samples/) , `/health` MVC Endpoints are exposed on http://localhost:9091/health ([provider](../dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider)) and http://localhost:8081/health ([consumer](../dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer)) - - `memory`, `load`, `threadpool` and `server` are Dubbo's build-in `StatusChecker`s in above example. Dubbo allows the application to extend `StatusChecker`'s SPI. +其中 `memory`, `load`, `threadpool` and `server` 是 Dubbo 内建的 `StatusChecker`s,并且 Dubbo 允许应用程序扩展 `StatusChecker`'s SPI. -Default , `memory` and `load` will be added into Dubbo's `HealthIndicator` , it could be overridden by externalized configuration [`StatusChecker`'s defaults](#statuschecker-defaults). +默认情况, `memory` and `load` 将被添加到 Dubbo 的 `HealthIndicator` , 可以通过外部化配置覆盖默认值,请参考 [`StatusChecker`'s 默认值](#statuschecker-defaults). ### JMX Endpoint : `healthEndpoint` - -`healthEndpoint` is a JMX (Java Management Extensions) Endpoint with ObjectName `org.springframework.boot:type=Endpoint,name=healthEndpoint` , it can be managed by JMX agent ,e.g. JDK tools : `jconsole` and so on. +`dubbo-spring-boot-actuator` 也将暴露健康检查的 JMX Endpoint,它的 `ObjectName` 为 `org.springframework.boot:type=Endpoint,name=healthEndpoint` , + 开发人员可以通过 JMX 代理工具 ,比如 `jconsole` 等: ![](JMX_HealthEndpoint.png) -### Build-in `StatusChecker`s - +### 内建 `StatusChecker`s - `META-INF/dubbo/internal/com.alibaba.dubbo.common.status.StatusChecker` declares Build-in `StatusChecker`s as follow : +Dubbo 内建 `StatusChecker` 实现定义在 `META-INF/dubbo/internal/com.alibaba.dubbo.common.status.StatusChecker` 文件中,内容如下 : ```properties registry=com.alibaba.dubbo.registry.status.RegistryStatusChecker @@ -172,13 +177,6 @@ Actuator endpoint `dubbo` supports Spring Web MVC Endpoints : "github": "https://github.com/dubbo/dubbo-spring-boot-project", "issues": "https://github.com/dubbo/dubbo-spring-boot-project/issues", "git": "https://github.com/dubbo/dubbo-spring-boot-project.git" - }, - "endpoints": { - "shutdown": "/shutdown", - "configs": "/configs", - "services": "/services", - "references": "/references", - "properties": "/properties" } } ``` diff --git a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java index 9a857f5..d96821d 100644 --- a/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java +++ b/dubbo-spring-boot-actuator/src/main/java/com/alibaba/boot/dubbo/actuate/endpoint/DubboEndpoint.java @@ -69,16 +69,8 @@ public class DubboEndpoint extends AbstractEndpoint<Map<String, Object>> { urls.put("issues", DUBBO_SPRING_BOOT_ISSUES_URL); urls.put("git", DUBBO_SPRING_BOOT_GIT_URL); - Map<String, String> endpoints = new LinkedHashMap<>(); - endpoints.put("shutdown", DUBBO_SHUTDOWN_ENDPOINT_URI); - endpoints.put("configs", DUBBO_CONFIGS_ENDPOINT_URI); - endpoints.put("services", DUBBO_SERVICES_ENDPOINT_URI); - endpoints.put("references", DUBBO_REFERENCES_ENDPOINT_URI); - endpoints.put("properties", DUBBO_PROPERTIES_ENDPOINT_URI); - metaData.put("versions", versions); metaData.put("urls", urls); - metaData.put("endpoints", endpoints); return metaData; } diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java index d410d90..5b105d6 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/java/com/alibaba/boot/dubbo/demo/consumer/controller/DemoConsumerController.java @@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController public class DemoConsumerController { - @Reference(version = "1.0.0", + @Reference(version = "${demo.service.version}", application = "${dubbo.application.id}", url = "dubbo://localhost:12345") private DemoService demoService; diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties index 7fc14dd..dbca837 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-consumer/src/main/resources/application.properties @@ -4,6 +4,9 @@ server.port = 8080 management.port = 8081 management.security.enabled = false +# Service Version +demo.service.version = 1.0.0 + # Dubbo Config properties ## ApplicationConfig Bean dubbo.application.id = dubbo-consumer-demo diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java index 79a9626..48bfc22 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/java/com/alibaba/boot/dubbo/demo/provider/service/DefaultDemoService.java @@ -27,7 +27,7 @@ import com.alibaba.dubbo.config.annotation.Service; * @since 1.0.0 */ @Service( - version = "1.0.0", + version = "${demo.service.version}", application = "${dubbo.application.id}", protocol = "${dubbo.protocol.id}", registry = "${dubbo.registry.id}" diff --git a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties index 9583845..5828a7f 100644 --- a/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties +++ b/dubbo-spring-boot-samples/dubbo-spring-boot-sample-provider/src/main/resources/application.properties @@ -4,6 +4,9 @@ server.port = 9090 management.port = 9091 management.security.enabled = false +# Service Version +demo.service.version = 1.0.0 + # Base packages to scan Dubbo Components (e.g @Service , @Reference) dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service -- To stop receiving notification emails like this one, please contact mercybl...@apache.org.