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 ca7459db7..b721036bd 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 c92f0bf10..877e4b81b 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 0d280ee8b..11ebe1516 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 {