From eaab60ebdb9b9d2bb866adb5b1d0efa1829385b7 Mon Sep 17 00:00:00 2001 From: tangyuewei <472680811@qq.com> Date: Tue, 30 Mar 2021 17:26:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E7=A9=BA=E6=A0=BC=EF=BC=8C=E6=9B=B4=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.properties | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/src/main/resources/bootstrap.properties b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/src/main/resources/bootstrap.properties index 4d880443..c9c1c9f6 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/src/main/resources/bootstrap.properties +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/src/main/resources/bootstrap.properties @@ -18,18 +18,18 @@ spring.cloud.nacos.password=nacos #spring.cloud.nacos.config.shared-data-ids=common.properties,base-common.properties ## recommended. -spring.cloud.nacos.config.shared-configs[0].data-id= test2.yaml +spring.cloud.nacos.config.shared-configs[0].data-id=test2.yaml spring.cloud.nacos.config.shared-configs[0].refresh=true ## the default value is 'DEFAULT_GROUP' , if not specified. -spring.cloud.nacos.config.shared-configs[0].group= GROUP_APP1 +spring.cloud.nacos.config.shared-configs[0].group=GROUP_APP1 ## not recommended. #spring.cloud.nacos.config.ext-config[0]=ext.properties ## recommended. -spring.cloud.nacos.config.extension-configs[0].data-id= extension1.properties +spring.cloud.nacos.config.extension-configs[0].data-id=extension1.properties spring.cloud.nacos.config.extension-configs[0].refresh=true -spring.cloud.nacos.config.extension-configs[1].data-id= test1.yml -spring.cloud.nacos.config.extension-configs[1].refresh= true +spring.cloud.nacos.config.extension-configs[1].data-id=test1.yml +spring.cloud.nacos.config.extension-configs[1].refresh=true From d653a1447667bfb7a8c6343511647ab5a11ed8b3 Mon Sep 17 00:00:00 2001 From: tangyuewei <472680811@qq.com> Date: Wed, 31 Mar 2021 16:54:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sentinel-example/sentinel-dubbo-example/readme-zh.md | 4 ++-- .../java/com/alibaba/cloud/examples/FooServiceConsumer.java | 4 ++-- .../main/java/com/alibaba/cloud/examples/FooServiceImpl.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/readme-zh.md b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/readme-zh.md index ca7459db..b721036b 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/readme-zh.md +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/readme-zh.md @@ -73,7 +73,7 @@ Provider端在application.properties文件中定义dubbo相关的配置,比如 定义具体的服务: - @Service( + @DubboService( version = "${foo.service.version}", application = "${dubbo.application.id}", protocol = "${dubbo.protocol.id}", @@ -111,7 +111,7 @@ Consumer端在服务调用之前,先定义限流规则。 根据Provider端中发布的定义,使用Dubbo的@Reference注解注入服务对应的Bean: - @Reference(version = "${foo.service.version}", application = "${dubbo.application.id}", + @DubboReference(version = "${foo.service.version}", application = "${dubbo.application.id}", path = "dubbo://localhost:12345", timeout = 30000) private FooService fooService; diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/src/main/java/com/alibaba/cloud/examples/FooServiceConsumer.java b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/src/main/java/com/alibaba/cloud/examples/FooServiceConsumer.java index c92f0bf1..877e4b81 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/src/main/java/com/alibaba/cloud/examples/FooServiceConsumer.java +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/src/main/java/com/alibaba/cloud/examples/FooServiceConsumer.java @@ -16,14 +16,14 @@ package com.alibaba.cloud.examples; -import org.apache.dubbo.config.annotation.Reference; +import org.apache.dubbo.config.annotation.DubboReference; /** * @author fangjian */ public class FooServiceConsumer { - @Reference(version = "${foo.service.version}", + @DubboReference(version = "${foo.service.version}", application = "${dubbo.application.id}", url = "dubbo://localhost:12345?version=1.0.0", timeout = 30000) private FooService fooService; diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/src/main/java/com/alibaba/cloud/examples/FooServiceImpl.java b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/src/main/java/com/alibaba/cloud/examples/FooServiceImpl.java index 0d280ee8..11ebe151 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/src/main/java/com/alibaba/cloud/examples/FooServiceImpl.java +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/src/main/java/com/alibaba/cloud/examples/FooServiceImpl.java @@ -16,12 +16,12 @@ package com.alibaba.cloud.examples; -import org.apache.dubbo.config.annotation.Service; +import org.apache.dubbo.config.annotation.DubboService; /** * @author fangjian */ -@Service(version = "${foo.service.version}", application = "${dubbo.application.id}", +@DubboService(version = "${foo.service.version}", application = "${dubbo.application.id}", protocol = "${dubbo.protocol.id}", registry = "${dubbo.registry.id}") public class FooServiceImpl implements FooService {