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-samples.git
The following commit(s) were added to refs/heads/master by this push: new c79de2129 Upgrade pom and README of module 'dubbo-samples-stub' (#1112) c79de2129 is described below commit c79de2129e20c07d6572c6a09519d48b6ec50781 Author: jerryoops <53827342+jerryo...@users.noreply.github.com> AuthorDate: Sun Mar 24 02:07:28 2024 -0700 Upgrade pom and README of module 'dubbo-samples-stub' (#1112) --- 2-advanced/dubbo-samples-stub/README.md | 13 ++++++++++--- 2-advanced/dubbo-samples-stub/{README.md => README_ZH.md} | 0 2-advanced/dubbo-samples-stub/case-versions.conf | 6 +++--- 2-advanced/dubbo-samples-stub/pom.xml | 8 ++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/2-advanced/dubbo-samples-stub/README.md b/2-advanced/dubbo-samples-stub/README.md index 04d31a981..acd227e55 100644 --- a/2-advanced/dubbo-samples-stub/README.md +++ b/2-advanced/dubbo-samples-stub/README.md @@ -1,5 +1,12 @@ # Dubbo-Samples-Stub -[本地存根相关文档](https://dubbo.apache.org/zh-cn/docs3-v2/java-sdk/advanced-features-and-usage/service/local-stub/) -* 该案例是关于实现本地存根的。远程服务后,客户端通常只剩下接口,而实现全在服务器端,但提供方有些时候想在客户端也执行部分逻辑。 -* 该案例的实现方式就是在interface包中定义DemoServiceStub,之后关键是在consumer端的service类声明的@DubboReference注解中设置stub属性为定义的stub类,设置interfaceName属性为interface的name。 +[Documentation of Local Stub](https://cn.dubbo.apache.org/en/docs/v2.7/user/examples/local-stub/) +* This sample is about the implementation of Local Stub. +When using RPC, the client usually only use the interface (which is implemented on provider side). +However, in certain circumstances, the client may also want to perform part of the logic. +For example: do ThreadLocal cache, verify parameters, return mock data when call fails, etc. + +* To solve this problem, you can configure the stub using API provided by dubbo, and this sample +shows how. In this sample, a "DemoServiceStub" is defined in the module of "dubbo-samples-stub-interface", +alongside with the interface class of "DemoService". The way to use this stub on consumer side +is explicitly configuring the "stub" and "interfaceName" fields of @DubboReference annotation. diff --git a/2-advanced/dubbo-samples-stub/README.md b/2-advanced/dubbo-samples-stub/README_ZH.md similarity index 100% copy from 2-advanced/dubbo-samples-stub/README.md copy to 2-advanced/dubbo-samples-stub/README_ZH.md diff --git a/2-advanced/dubbo-samples-stub/case-versions.conf b/2-advanced/dubbo-samples-stub/case-versions.conf index b03fb1ae4..82aeb4560 100644 --- a/2-advanced/dubbo-samples-stub/case-versions.conf +++ b/2-advanced/dubbo-samples-stub/case-versions.conf @@ -20,6 +20,6 @@ # Supported component versions of the test case # Spring app -dubbo.version=3.* -spring.version=4.*, 5.* -java.version= [>= 8] +dubbo.version=3.3.* +spring.version=6.* +java.version= [>= 17] diff --git a/2-advanced/dubbo-samples-stub/pom.xml b/2-advanced/dubbo-samples-stub/pom.xml index dd6c0921c..4fe19eeaa 100644 --- a/2-advanced/dubbo-samples-stub/pom.xml +++ b/2-advanced/dubbo-samples-stub/pom.xml @@ -42,12 +42,12 @@ </modules> <properties> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> + <maven.compiler.source>17</maven.compiler.source> + <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <dubbo.version>3.2.6</dubbo.version> - <spring-boot.version>2.7.8</spring-boot.version> + <dubbo.version>3.3.0-beta.1</dubbo.version> + <spring-boot.version>3.2.3</spring-boot.version> <junit.version>4.13.1</junit.version> </properties> --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org