Add nacos and gateway examples (#1143)
diff --git a/1-basic/dubbo-samples-spring-boot-idl/README.md b/1-basic/dubbo-samples-spring-boot-idl/README.md
index 80b9798..7ff698d 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/README.md
+++ b/1-basic/dubbo-samples-spring-boot-idl/README.md
@@ -4,10 +4,10 @@
# How to run
-## Start Zookeeper
-This example replies on Zookeeper(3.8.0+) as service discovery registry center, so you need to run the Zookeeper server first, there are two ways to do so:
-1. [Download zookeeper binary and start it directly](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/zookeeper/#本地下载)
-2. [Start zookeeper using docker](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/zookeeper/#docker)
+## Start Nacos
+This example replies on Nacos as service discovery registry center, so you need to run the Nacos server first, there are two ways to do so:
+1. [Download Nacos binary and start it directly](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/#本地下载)
+2. [Start Nacos using docker](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/#docker)
## Compile
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java
index adfe66b..48eba35 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
- package org.apache.dubbo.springboot.demo.idl;
+package org.apache.dubbo.springboot.demo.idl;
import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.common.URL;
@@ -63,23 +63,27 @@
}
private static final StubMethodDescriptor greetMethod = new StubMethodDescriptor("greet",
- org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
+ org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), org.apache.dubbo.springboot.demo.idl.GreeterRequest::parseFrom,
org.apache.dubbo.springboot.demo.idl.GreeterReply::parseFrom);
private static final StubMethodDescriptor greetAsyncMethod = new StubMethodDescriptor("greet",
- org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
+ org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, java.util.concurrent.CompletableFuture.class, MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), org.apache.dubbo.springboot.demo.idl.GreeterRequest::parseFrom,
org.apache.dubbo.springboot.demo.idl.GreeterReply::parseFrom);
private static final StubMethodDescriptor greetProxyAsyncMethod = new StubMethodDescriptor("greetAsync",
- org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
+ org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), org.apache.dubbo.springboot.demo.idl.GreeterRequest::parseFrom,
org.apache.dubbo.springboot.demo.idl.GreeterReply::parseFrom);
+ static{
+ serviceDescriptor.addMethod(greetMethod);
+ serviceDescriptor.addMethod(greetProxyAsyncMethod);
+ }
public static class GreeterStub implements Greeter{
private final Invoker<Greeter> invoker;
@@ -97,7 +101,6 @@
return StubInvocationUtil.unaryCall(invoker, greetAsyncMethod, request);
}
- @Override
public void greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply> responseObserver){
StubInvocationUtil.unaryCall(invoker, greetMethod , request, responseObserver);
}
@@ -124,14 +127,38 @@
}
@Override
+ public CompletableFuture<org.apache.dubbo.springboot.demo.idl.GreeterReply> greetAsync(org.apache.dubbo.springboot.demo.idl.GreeterRequest request){
+ return CompletableFuture.completedFuture(greet(request));
+ }
+
+ /**
+ * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
+ * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
+ */
+ public void greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply> responseObserver){
+ greetAsync(request).whenComplete((r, t) -> {
+ if (t != null) {
+ responseObserver.onError(t);
+ } else {
+ responseObserver.onNext(r);
+ responseObserver.onCompleted();
+ }
+ });
+ }
+
+ @Override
public final Invoker<Greeter> getInvoker(URL url) {
PathResolver pathResolver = url.getOrDefaultFrameworkModel()
.getExtensionLoader(PathResolver.class)
.getDefaultExtension();
Map<String,StubMethodHandler<?, ?>> handlers = new HashMap<>();
- pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greet" );
- pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greetAsync" );
+ pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greet");
+ pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greetAsync");
+ // for compatibility
+ pathResolver.addNativeStub( "/" + JAVA_SERVICE_NAME + "/greet");
+ pathResolver.addNativeStub( "/" + JAVA_SERVICE_NAME + "/greetAsync");
+
BiConsumer<org.apache.dubbo.springboot.demo.idl.GreeterRequest, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply>> greetFunc = this::greet;
handlers.put(greetMethod.getMethodName(), new UnaryStubMethodHandler<>(greetFunc));
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java
index c109cc3..14d1c2b 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
- package org.apache.dubbo.springboot.demo.idl;
+package org.apache.dubbo.springboot.demo.idl;
import org.apache.dubbo.common.stream.StreamObserver;
import com.google.protobuf.Message;
@@ -29,27 +29,11 @@
String JAVA_SERVICE_NAME = "org.apache.dubbo.springboot.demo.idl.Greeter";
String SERVICE_NAME = "org.apache.dubbo.springboot.demo.idl.Greeter";
-
org.apache.dubbo.springboot.demo.idl.GreeterReply greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request);
- default CompletableFuture<org.apache.dubbo.springboot.demo.idl.GreeterReply> greetAsync(org.apache.dubbo.springboot.demo.idl.GreeterRequest request){
- return CompletableFuture.completedFuture(greet(request));
- }
+ CompletableFuture<org.apache.dubbo.springboot.demo.idl.GreeterReply> greetAsync(org.apache.dubbo.springboot.demo.idl.GreeterRequest request);
- /**
- * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
- * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
- */
- default void greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply> responseObserver){
- greetAsync(request).whenComplete((r, t) -> {
- if (t != null) {
- responseObserver.onError(t);
- } else {
- responseObserver.onNext(r);
- responseObserver.onCompleted();
- }
- });
- }
+
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/pom.xml b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/pom.xml
index d06db4b..0a75b4e 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/pom.xml
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/pom.xml
@@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-zookeeper-curator5-spring-boot-starter</artifactId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency>
<!-- spring starter -->
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/src/main/resources/application.yml b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/src/main/resources/application.yml
index 835922e..af2a254 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/src/main/resources/application.yml
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-consumer/src/main/resources/application.yml
@@ -19,4 +19,4 @@
name: dubbo-springboot-demo-consumer
logger: slf4j
registry:
- address: zookeeper://${zookeeper.address:127.0.0.1}:2181
+ address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java
index adfe66b..48eba35 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/DubboGreeterTriple.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
- package org.apache.dubbo.springboot.demo.idl;
+package org.apache.dubbo.springboot.demo.idl;
import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.common.URL;
@@ -63,23 +63,27 @@
}
private static final StubMethodDescriptor greetMethod = new StubMethodDescriptor("greet",
- org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
+ org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), org.apache.dubbo.springboot.demo.idl.GreeterRequest::parseFrom,
org.apache.dubbo.springboot.demo.idl.GreeterReply::parseFrom);
private static final StubMethodDescriptor greetAsyncMethod = new StubMethodDescriptor("greet",
- org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, java.util.concurrent.CompletableFuture.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
+ org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, java.util.concurrent.CompletableFuture.class, MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), org.apache.dubbo.springboot.demo.idl.GreeterRequest::parseFrom,
org.apache.dubbo.springboot.demo.idl.GreeterReply::parseFrom);
private static final StubMethodDescriptor greetProxyAsyncMethod = new StubMethodDescriptor("greetAsync",
- org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, serviceDescriptor, MethodDescriptor.RpcType.UNARY,
+ org.apache.dubbo.springboot.demo.idl.GreeterRequest.class, org.apache.dubbo.springboot.demo.idl.GreeterReply.class, MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(), obj -> ((Message) obj).toByteArray(), org.apache.dubbo.springboot.demo.idl.GreeterRequest::parseFrom,
org.apache.dubbo.springboot.demo.idl.GreeterReply::parseFrom);
+ static{
+ serviceDescriptor.addMethod(greetMethod);
+ serviceDescriptor.addMethod(greetProxyAsyncMethod);
+ }
public static class GreeterStub implements Greeter{
private final Invoker<Greeter> invoker;
@@ -97,7 +101,6 @@
return StubInvocationUtil.unaryCall(invoker, greetAsyncMethod, request);
}
- @Override
public void greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply> responseObserver){
StubInvocationUtil.unaryCall(invoker, greetMethod , request, responseObserver);
}
@@ -124,14 +127,38 @@
}
@Override
+ public CompletableFuture<org.apache.dubbo.springboot.demo.idl.GreeterReply> greetAsync(org.apache.dubbo.springboot.demo.idl.GreeterRequest request){
+ return CompletableFuture.completedFuture(greet(request));
+ }
+
+ /**
+ * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
+ * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
+ */
+ public void greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply> responseObserver){
+ greetAsync(request).whenComplete((r, t) -> {
+ if (t != null) {
+ responseObserver.onError(t);
+ } else {
+ responseObserver.onNext(r);
+ responseObserver.onCompleted();
+ }
+ });
+ }
+
+ @Override
public final Invoker<Greeter> getInvoker(URL url) {
PathResolver pathResolver = url.getOrDefaultFrameworkModel()
.getExtensionLoader(PathResolver.class)
.getDefaultExtension();
Map<String,StubMethodHandler<?, ?>> handlers = new HashMap<>();
- pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greet" );
- pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greetAsync" );
+ pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greet");
+ pathResolver.addNativeStub( "/" + SERVICE_NAME + "/greetAsync");
+ // for compatibility
+ pathResolver.addNativeStub( "/" + JAVA_SERVICE_NAME + "/greet");
+ pathResolver.addNativeStub( "/" + JAVA_SERVICE_NAME + "/greetAsync");
+
BiConsumer<org.apache.dubbo.springboot.demo.idl.GreeterRequest, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply>> greetFunc = this::greet;
handlers.put(greetMethod.getMethodName(), new UnaryStubMethodHandler<>(greetFunc));
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java
index c109cc3..14d1c2b 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/build/generated/source/proto/main/java/org/apache/dubbo/springboot/demo/idl/Greeter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
- package org.apache.dubbo.springboot.demo.idl;
+package org.apache.dubbo.springboot.demo.idl;
import org.apache.dubbo.common.stream.StreamObserver;
import com.google.protobuf.Message;
@@ -29,27 +29,11 @@
String JAVA_SERVICE_NAME = "org.apache.dubbo.springboot.demo.idl.Greeter";
String SERVICE_NAME = "org.apache.dubbo.springboot.demo.idl.Greeter";
-
org.apache.dubbo.springboot.demo.idl.GreeterReply greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request);
- default CompletableFuture<org.apache.dubbo.springboot.demo.idl.GreeterReply> greetAsync(org.apache.dubbo.springboot.demo.idl.GreeterRequest request){
- return CompletableFuture.completedFuture(greet(request));
- }
+ CompletableFuture<org.apache.dubbo.springboot.demo.idl.GreeterReply> greetAsync(org.apache.dubbo.springboot.demo.idl.GreeterRequest request);
- /**
- * This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
- * It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
- */
- default void greet(org.apache.dubbo.springboot.demo.idl.GreeterRequest request, StreamObserver<org.apache.dubbo.springboot.demo.idl.GreeterReply> responseObserver){
- greetAsync(request).whenComplete((r, t) -> {
- if (t != null) {
- responseObserver.onError(t);
- } else {
- responseObserver.onNext(r);
- responseObserver.onCompleted();
- }
- });
- }
+
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/pom.xml b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/pom.xml
index 1dacc74..178474e 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/pom.xml
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/pom.xml
@@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-zookeeper-curator5-spring-boot-starter</artifactId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency>
<!-- spring starter -->
diff --git a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/src/main/resources/application.yml b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/src/main/resources/application.yml
index 4ee1f02..f9c0db8 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/src/main/resources/application.yml
+++ b/1-basic/dubbo-samples-spring-boot-idl/dubbo-samples-spring-boot-idl-provider/src/main/resources/application.yml
@@ -22,4 +22,4 @@
name: tri
port: 50052
registry:
- address: zookeeper://${zookeeper.address:127.0.0.1}:2181
+ address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos
diff --git a/1-basic/dubbo-samples-spring-boot-idl/pom.xml b/1-basic/dubbo-samples-spring-boot-idl/pom.xml
index fb6f06d..6dba99d 100644
--- a/1-basic/dubbo-samples-spring-boot-idl/pom.xml
+++ b/1-basic/dubbo-samples-spring-boot-idl/pom.xml
@@ -40,7 +40,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dubbo.version>3.3.0-beta.1</dubbo.version>
+ <dubbo.version>3.3.0-beta.2</dubbo.version>
<spring-boot.version>3.2.3</spring-boot.version>
<protobuf-java.version>3.19.6</protobuf-java.version>
<protoc.version>3.22.3</protoc.version>
diff --git a/1-basic/dubbo-samples-spring-boot/README.md b/1-basic/dubbo-samples-spring-boot/README.md
index 3e6d692..441831d 100644
--- a/1-basic/dubbo-samples-spring-boot/README.md
+++ b/1-basic/dubbo-samples-spring-boot/README.md
@@ -14,10 +14,10 @@
# How to run
-## Start Zookeeper
-This example replies on Zookeeper(3.8.0+) as service discovery registry center, so you need to run the Zookeeper server first, there are two ways to do so:
-1. [Download zookeeper binary and start it directly](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/zookeeper/#本地下载)
-2. [Start zookeeper using docker](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/zookeeper/#docker)
+## Start Nacos
+This example replies on Nacos as service discovery registry center, so you need to run the Nacos server first, there are two ways to do so:
+1. [Download Nacos binary and start it directly](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/#本地下载)
+2. [Start Nacos using docker](https://dubbo-next.staged.apache.org/zh-cn/overview/reference/integrations/nacos/#docker)
## Install dependencies
Step into 'dubbo-samples-spring-boot' directory, run the following command:
diff --git a/1-basic/dubbo-samples-spring-boot/case-configuration.yml b/1-basic/dubbo-samples-spring-boot/case-configuration.yml
index b1721bc..ece9c2d 100644
--- a/1-basic/dubbo-samples-spring-boot/case-configuration.yml
+++ b/1-basic/dubbo-samples-spring-boot/case-configuration.yml
@@ -15,19 +15,33 @@
# limitations under the License.
services:
- zookeeper:
- image: zookeeper:latest
+ nacos:
+ image: nacos/nacos-server:${nacos-server.version:2.0.0}
+ environment:
+ - PREFER_HOST_MODE=hostname
+ - MODE=standalone
+ - NACOS_AUTH_ENABLE=true
+ - JVM_XMS=512m
+ - JVM_XMX=512m
+ - JVM_XMN=256m
+ healthcheck:
+ test: 'curl -Ss http://localhost:8848/nacos'
+ interval: 5s
+ timeout: 5s
+ retries: 40
provider:
type: app
basedir: dubbo-samples-spring-boot-provider
mainClass: org.apache.dubbo.springboot.demo.provider.ProviderApplication
systemProps:
- - zookeeper.address=zookeeper
+ - nacos.address=nacos
waitPortsBeforeRun:
- - zookeeper:2181
+ - nacos:8848
checkPorts:
- 50052
+ depends_on:
+ - nacos
checkLog: "Current Spring Boot Application is await..."
test:
@@ -36,9 +50,9 @@
tests:
- "**/*IT.class"
systemProps:
- - zookeeper.address=zookeeper
+ - nacos.address=nacos
waitPortsBeforeRun:
- - zookeeper:2181
+ - nacos:8848
- provider:50052
depends_on:
- provider
diff --git a/1-basic/dubbo-samples-spring-boot/case-version-sources.conf b/1-basic/dubbo-samples-spring-boot/case-version-sources.conf
new file mode 100644
index 0000000..5b1472a
--- /dev/null
+++ b/1-basic/dubbo-samples-spring-boot/case-version-sources.conf
@@ -0,0 +1,20 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+nacos.version=https://repo1.maven.org/maven2/com/alibaba/nacos/nacos-client/maven-metadata.xml
+#nacos-server.version=https://hub.docker.com/v2/namespaces/nacos/repositories/nacos-server/tags
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-spring-boot/case-versions.conf b/1-basic/dubbo-samples-spring-boot/case-versions.conf
index 82aeb45..67f3eae 100644
--- a/1-basic/dubbo-samples-spring-boot/case-versions.conf
+++ b/1-basic/dubbo-samples-spring-boot/case-versions.conf
@@ -23,3 +23,4 @@
dubbo.version=3.3.*
spring.version=6.*
java.version= [>= 17]
+nacos.version="!*-BETA","!*-ALPHA*",2.*
diff --git a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/pom.xml b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/pom.xml
index e88dbf2..bfd9064 100644
--- a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/pom.xml
+++ b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/pom.xml
@@ -41,21 +41,7 @@
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-zookeeper-curator5-spring-boot-starter</artifactId>
- <exclusions>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </exclusion>
- </exclusions>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency>
<!-- spring starter -->
diff --git a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/src/main/resources/application.yml b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/src/main/resources/application.yml
index f0c03c0..63c6770 100644
--- a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/src/main/resources/application.yml
+++ b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-consumer/src/main/resources/application.yml
@@ -20,4 +20,4 @@
logger: slf4j
qos-port: 33333
registry:
- address: zookeeper://${zookeeper.address:127.0.0.1}:2181
+ address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos
diff --git a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/pom.xml b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/pom.xml
index 0633cc7..94ccb5d 100644
--- a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/pom.xml
+++ b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/pom.xml
@@ -41,21 +41,7 @@
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-zookeeper-curator5-spring-boot-starter</artifactId>
- <exclusions>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </exclusion>
- </exclusions>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency>
<!-- spring starter -->
diff --git a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/src/main/resources/application.yml b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/src/main/resources/application.yml
index 94860ea..5608973 100644
--- a/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/src/main/resources/application.yml
+++ b/1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/src/main/resources/application.yml
@@ -22,4 +22,4 @@
name: tri
port: 50052
registry:
- address: zookeeper://${zookeeper.address:127.0.0.1}:2181
+ address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos
diff --git a/1-basic/dubbo-samples-spring-boot/pom.xml b/1-basic/dubbo-samples-spring-boot/pom.xml
index cdbeca7..7c34f74 100644
--- a/1-basic/dubbo-samples-spring-boot/pom.xml
+++ b/1-basic/dubbo-samples-spring-boot/pom.xml
@@ -40,7 +40,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dubbo.version>3.3.0-beta.1</dubbo.version>
+ <dubbo.version>3.3.0-beta.2</dubbo.version>
<spring-boot.version>3.2.3</spring-boot.version>
</properties>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/README.md b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/README.md
index fb34b3d..9682ced 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/README.md
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/README.md
@@ -12,7 +12,7 @@
This document uses Docker installation, which is relatively simple
-To install APISIX using this method, you need to install [Docker](https://www.docker.com/) And
+To install APISIX using this method, you need to install [Docker](https://www.docker.com/) And
[docker-compose](https://docs.docker.com/compose/)
@@ -35,11 +35,11 @@
- dubbo-proxy
```
-Then note that due to the need to connect to the Nacos registry, it is necessary to modify the
+Then note that due to the need to connect to the Nacos registry, it is necessary to modify the
`cd apisix-docker/example`
-`vi docker-compose.yml`
+`vi docker-compose.yml`
Add the following content
```yaml
@@ -56,7 +56,7 @@
apisix:
```
-Finally, use Docker Compose to enable APISIX:
+Finally, use Docker Compose to enable APISIX:
`docker-compose -p docker-apisix up -d`
@@ -66,17 +66,15 @@
Create an Upstream pointing to Dubbo Provider using curl.
```yaml
-curl [http://127.0.0.1:9180/apisix/admin/upstreams/1](http://127.0.0.1:9180/apisix/admin/upstreams/1) -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+curl http://127.0.0.1:9180/apisix/admin/upstreams/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
- "nodes": {
- "10.21.32.168:20880": 1
- },
+ "service_name": "gateway-apisix-dubbo",
"type": "roundrobin",
"discovery_type": "nacos"
}'
```
-Expose an HTTP route for ApisixService
+Expose an HTTP route for ApisixService, the following configuration will forward requests starting with `/dubbo` to backend dubbo service `org.apache.dubbo.samples.api.ApisixService` and method `apisixDubbo`.
```yaml
curl [http://127.0.0.1:9180/apisix/admin/routes/1](http://127.0.0.1:9180/apisix/admin/routes/1) -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -86,7 +84,7 @@
],
"plugins": {
"dubbo-proxy": {
- "service_name": "org.apache.dubbo.samples.api.ApisixService",
+ "service_name": "org.apache.dubbo.samples.gateway.apisix.dubboapi.ApisixService",
"service_version": "0.0.0",
"method": "apisixToDubbo"
}
@@ -112,4 +110,4 @@
Key = user-agent, Value = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/53
```
-At this point, the most basic use of the Apisix proxy dubbo service sample has been completed
\ No newline at end of file
+At this point, the most basic use of the Apisix proxy dubbo service sample has been completed
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/pom.xml
index 8fcf573..78c5ed5 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/pom.xml
@@ -42,6 +42,10 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
+ </dependency>
<!-- spring starter -->
<dependency>
@@ -66,6 +70,14 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/consumer/ConsumerApplication.java
similarity index 94%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/consumer/ConsumerApplication.java
index 5cac7b9..3316759 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/consumer/ConsumerApplication.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.consumer;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.consumer;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/Task.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/consumer/Task.java
similarity index 92%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/Task.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/consumer/Task.java
index aee2034..73abebc 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/Task.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/consumer/Task.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.consumer;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.consumer;
import org.apache.dubbo.config.annotation.DubboReference;
-import org.apache.dubbo.samples.api.DemoService;
+import org.apache.dubbo.samples.gateway.apisix.dubbo.api.DemoService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.Date;
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/ApisixService.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway.apisix.dubbo/api/ApisixService.java
similarity index 93%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/ApisixService.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway.apisix.dubbo/api/ApisixService.java
index cd71f6a..aacd6b9 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/ApisixService.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway.apisix.dubbo/api/ApisixService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.api;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.api;
import java.util.Map;
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway.apisix.dubbo/api/DemoService.java
similarity index 93%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway.apisix.dubbo/api/DemoService.java
index 202775d..ac33c95 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway.apisix.dubbo/api/DemoService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.api;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.api;
public interface DemoService {
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/pom.xml
index 1e151d5..7debc94 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/pom.xml
@@ -93,6 +93,14 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ApisixServiceImpl.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/ApisixServiceImpl.java
similarity index 91%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ApisixServiceImpl.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/ApisixServiceImpl.java
index ebc5bcc..99f052c 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ApisixServiceImpl.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/ApisixServiceImpl.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.provider;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.provider;
import org.apache.dubbo.config.annotation.DubboService;
-import org.apache.dubbo.samples.api.ApisixService;
+import org.apache.dubbo.samples.gateway.apisix.dubbo.api.ApisixService;
import java.util.HashMap;
import java.util.Map;
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/DemoServiceImpl.java
similarity index 88%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/DemoServiceImpl.java
index e875f4d..1a6eae8 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/DemoServiceImpl.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.provider;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.provider;
import org.apache.dubbo.config.annotation.DubboService;
-import org.apache.dubbo.samples.api.DemoService;
+import org.apache.dubbo.samples.gateway.apisix.dubbo.api.DemoService;
@DubboService
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/ProviderApplication.java
similarity index 94%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/ProviderApplication.java
index 6c6f9e8..eb5a6cb 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/apisix.dubbo/provider/ProviderApplication.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.provider;
+package org.apache.dubbo.samples.gateway.apisix.dubbo.provider;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/resources/application.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/resources/application.yml
index af32904..6924538 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/resources/application.yml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/resources/application.yml
@@ -16,11 +16,10 @@
port: 8888
dubbo:
application:
- name: dubbo-gateway-provider
+ name: gateway-apisix-dubbo
protocol:
name: dubbo
port: 20880
- serialization: fastjson2
registry:
address: nacos://${nacos.address:127.0.0.1}:8848
username: nacos
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/pom.xml
index 21cd99f..fe9ac7d 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/pom.xml
@@ -37,7 +37,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>3.2.3</spring-boot.version>
- <dubbo.version>3.3.0-beta.1</dubbo.version>
+ <dubbo.version>3.3.0-beta.2</dubbo.version>
<dubbo-nacos.version>3.2.0</dubbo-nacos.version>
</properties>
<modules>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/README.md b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/README.md
new file mode 100644
index 0000000..99f3815
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/README.md
@@ -0,0 +1 @@
+Please visit [the official website](http://dubbo.apache.org/zh-cn/blog/2024/04/22/%E4%BD%BF%E7%94%A8-apache-apisix-%E4%BB%A3%E7%90%86-dubbo-%E6%9C%8D%E5%8A%A1triple%E5%8D%8F%E8%AE%AE/) for more details of this example.
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/docker-compose.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/docker-compose.yml
new file mode 100644
index 0000000..779faa4
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/docker-compose.yml
@@ -0,0 +1,118 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+version: "3"
+
+services:
+ apisix:
+ image: apache/apisix:${APISIX_IMAGE_TAG:-3.9.0-debian}
+ restart: always
+ volumes:
+ - ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
+ depends_on:
+ - etcd
+ ##network_mode: host
+ ports:
+ - "9180:9180/tcp"
+ - "9080:9080/tcp"
+ - "9091:9091/tcp"
+ - "9443:9443/tcp"
+ - "9092:9092/tcp"
+ networks:
+ apisix:
+
+ etcd:
+ image: bitnami/etcd:3.5.11
+ restart: always
+ volumes:
+ - etcd_data:/bitnami/etcd
+ environment:
+ ETCD_ENABLE_V2: "true"
+ ALLOW_NONE_AUTHENTICATION: "yes"
+ ETCD_ADVERTISE_CLIENT_URLS: "http://etcd:2379"
+ ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
+ ports:
+ - "2379:2379/tcp"
+ networks:
+ apisix:
+
+
+ nacos:
+ image: nacos/nacos-server:v2.1.1
+ container_name: nacos-standalone
+ environment:
+ - PREFER_HOST_MODE=hostname
+ - MODE=standalone
+ ports:
+ - "8848:8848"
+ - "9848:9848"
+ networks:
+ apisix:
+
+ web1:
+ image: nginx:1.19.0-alpine
+ restart: always
+ volumes:
+ - ./upstream/web1.conf:/etc/nginx/nginx.conf
+ ports:
+ - "9081:80/tcp"
+ environment:
+ - NGINX_PORT=80
+ networks:
+ apisix:
+
+ web2:
+ image: nginx:1.19.0-alpine
+ restart: always
+ volumes:
+ - ./upstream/web2.conf:/etc/nginx/nginx.conf
+ ports:
+ - "9082:80/tcp"
+ environment:
+ - NGINX_PORT=80
+ networks:
+ apisix:
+
+ prometheus:
+ image: prom/prometheus:v2.25.0
+ restart: always
+ volumes:
+ - ./prometheus_conf/prometheus.yml:/etc/prometheus/prometheus.yml
+ ports:
+ - "9090:9090"
+ networks:
+ apisix:
+
+ grafana:
+ image: grafana/grafana:7.3.7
+ restart: always
+ ports:
+ - "3000:3000"
+ volumes:
+ - "./grafana_conf/provisioning:/etc/grafana/provisioning"
+ - "./grafana_conf/dashboards:/var/lib/grafana/dashboards"
+ - "./grafana_conf/config/grafana.ini:/etc/grafana/grafana.ini"
+ networks:
+ apisix:
+
+networks:
+ apisix:
+ driver: bridge
+
+volumes:
+ etcd_data:
+ driver: local
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/pom.xml
new file mode 100644
index 0000000..739741d
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-gateway-apisix</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-gateway-apisix-triple</artifactId>
+
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <!-- dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
+ </dependency>
+
+ <!-- spring starter -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/DemoService.java
similarity index 94%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/DemoService.java
index 202775d..16232bd 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/DemoService.java
@@ -14,10 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.api;
+package org.apache.dubbo.samples.gateway.apisix;
public interface DemoService {
-
String sayHello(String name);
-
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/ProviderApplication.java
similarity index 91%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/ProviderApplication.java
index 6c6f9e8..fc89552 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/ProviderApplication.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.provider;
+package org.apache.dubbo.samples.gateway.apisix;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
@@ -24,7 +24,9 @@
@SpringBootApplication
@EnableDubbo
public class ProviderApplication {
+
public static void main(String[] args) {
SpringApplication.run(ProviderApplication.class, args);
+ System.out.println("dubbo service started");
}
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/impl/DemoServiceImpl.java
similarity index 88%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/impl/DemoServiceImpl.java
index e875f4d..014ed10 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/java/org/apache/dubbo/samples/gateway/apisix/impl/DemoServiceImpl.java
@@ -14,15 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.provider;
+package org.apache.dubbo.samples.gateway.apisix.impl;
import org.apache.dubbo.config.annotation.DubboService;
-import org.apache.dubbo.samples.api.DemoService;
-
+import org.apache.dubbo.samples.gateway.apisix.DemoService;
@DubboService
public class DemoServiceImpl implements DemoService {
+
+ @Override
public String sayHello(String name) {
return "Hello " + name;
}
+
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/resources/application.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/resources/application.yml
new file mode 100644
index 0000000..6c183ea
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/resources/application.yml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+server:
+ port: 8080
+dubbo:
+ application:
+ logger: slf4j
+ name: gateway-apisix-triple
+ qos-port: 33333
+ registry:
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
+ protocol:
+ name: tri
+ port: 50052
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/resources/log4j2.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..69e1321
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-triple/src/main/resources/log4j2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT" follow="true">
+ <PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/pom.xml
index 310af2a..f5136be 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/pom.xml
@@ -1,35 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <!--
- ~
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-samples-gateway</artifactId>
- <version>1.0-SNAPSHOT</version>
- </parent>
+
+ <packaging>pom</packaging>
<artifactId>dubbo-samples-gateway-apisix</artifactId>
- <packaging>pom</packaging>
- <name>Dubbo Samples Gateway Apisix</name>
- <description>Dubbo Samples Gateway Apisix</description>
+
<modules>
+ <module>dubbo-samples-gateway-apisix-triple</module>
<module>dubbo-samples-gateway-apisix-dubbo</module>
</modules>
@@ -37,14 +38,82 @@
<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.3.0-beta.2</dubbo.version>
+ <log4j2.version>2.20.0</log4j2.version>
+ <junit.version>4.13.1</junit.version>
+ <spring.version>6.1.5</spring.version>
+ <spring-boot.version>3.2.3</spring-boot.version>
+
+ <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
</properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-framework-bom</artifactId>
+ <version>${spring.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring-boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-bom</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgs>
+ <compilerArg>-proc:none</compilerArg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/README.md b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/README.md
new file mode 100644
index 0000000..7d65356
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/README.md
@@ -0,0 +1 @@
+Please visit [the official website](http://dubbo-next.apache.org/zh-cn/overview/mannual/java-sdk/tasks/gateway/dubbo/) for more details of this example.
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/dubbo-proxy/proxy-interface-registry.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/dubbo-proxy/proxy-interface-registry.yaml
new file mode 100644
index 0000000..0d050c9
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/dubbo-proxy/proxy-interface-registry.yaml
@@ -0,0 +1,91 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: networking.istio.io/v1alpha3
+kind: EnvoyFilter
+metadata:
+ name: http-dubbo-transcoder-test
+ namespace: higress-system
+spec:
+ configPatches:
+ - applyTo: HTTP_FILTER
+ match:
+ context: GATEWAY
+ listener:
+ filterChain:
+ filter:
+ name: envoy.filters.network.http_connection_manager
+ subFilter:
+ name: envoy.filters.http.router
+ patch:
+ operation: INSERT_BEFORE
+ value:
+ name: envoy.filters.http.http_dubbo_transcoder
+ typed_config:
+ '@type': type.googleapis.com/udpa.type.v1.TypedStruct
+ type_url: type.googleapis.com/envoy.extensions.filters.http.http_dubbo_transcoder.v3.HttpDubboTranscoder
+ - applyTo: HTTP_ROUTE
+ match:
+ context: GATEWAY
+ routeConfiguration:
+ vhost:
+ route:
+ name: demo
+ patch:
+ operation: MERGE
+ value:
+ route:
+ upgrade_configs:
+ - connect_config:
+ allow_post: true
+ upgrade_type: CONNECT
+ typed_per_filter_config:
+ envoy.filters.http.http_dubbo_transcoder:
+ '@type': type.googleapis.com/udpa.type.v1.TypedStruct
+ type_url: type.googleapis.com/envoy.extensions.filters.http.http_dubbo_transcoder.v3.HttpDubboTranscoder
+ value:
+ request_validation_options:
+ reject_unknown_method: true
+ reject_unknown_query_parameters: true
+ services_mapping:
+ - group: dev
+ method_mapping:
+ - name: sayName
+ parameter_mapping:
+ - extract_key: p
+ extract_key_spec: ALL_QUERY_PARAMETER
+ mapping_type: java.lang.String
+ passthrough_setting:
+ passthrough_all_headers: true
+ path_matcher:
+ match_http_method_spec: ALL_GET
+ match_pattern: /dubbo/hello
+ name: org.apache.dubbo.samples.gateway.api.DemoService
+ version: 1.0.0
+ url_unescape_spec: ALL_CHARACTERS_EXCEPT_RESERVED
+ - applyTo: CLUSTER
+ match:
+ cluster:
+ service: providers:org.apache.dubbo.samples.gateway.api.DemoService:1.0.0:dev.DEFAULT-GROUP.public.nacos
+ context: GATEWAY
+ patch:
+ operation: MERGE
+ value:
+ upstream_config:
+ name: envoy.upstreams.http.dubbo_tcp
+ typed_config:
+ '@type': type.googleapis.com/udpa.type.v1.TypedStruct
+ type_url: type.googleapis.com/envoy.extensions.upstreams.http.dubbo_tcp.v3.DubboTcpConnectionPoolProto
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/dubbo-proxy/proxy.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/dubbo-proxy/proxy.yaml
new file mode 100644
index 0000000..d7f8ba8
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/dubbo-proxy/proxy.yaml
@@ -0,0 +1,91 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: networking.istio.io/v1alpha3
+kind: EnvoyFilter
+metadata:
+ name: http-dubbo-transcoder-test
+ namespace: higress-system
+spec:
+ configPatches:
+ - applyTo: HTTP_FILTER
+ match:
+ context: GATEWAY
+ listener:
+ filterChain:
+ filter:
+ name: envoy.filters.network.http_connection_manager
+ subFilter:
+ name: envoy.filters.http.router
+ patch:
+ operation: INSERT_BEFORE
+ value:
+ name: envoy.filters.http.http_dubbo_transcoder
+ typed_config:
+ '@type': type.googleapis.com/udpa.type.v1.TypedStruct
+ type_url: type.googleapis.com/envoy.extensions.filters.http.http_dubbo_transcoder.v3.HttpDubboTranscoder
+ - applyTo: HTTP_ROUTE
+ match:
+ context: GATEWAY
+ routeConfiguration:
+ vhost:
+ route:
+ name: demo
+ patch:
+ operation: MERGE
+ value:
+ route:
+ upgrade_configs:
+ - connect_config:
+ allow_post: true
+ upgrade_type: CONNECT
+ typed_per_filter_config:
+ envoy.filters.http.http_dubbo_transcoder:
+ '@type': type.googleapis.com/udpa.type.v1.TypedStruct
+ type_url: type.googleapis.com/envoy.extensions.filters.http.http_dubbo_transcoder.v3.HttpDubboTranscoder
+ value:
+ request_validation_options:
+ reject_unknown_method: true
+ reject_unknown_query_parameters: true
+ services_mapping:
+ - group: dev
+ method_mapping:
+ - name: sayName
+ parameter_mapping:
+ - extract_key: p
+ extract_key_spec: ALL_QUERY_PARAMETER
+ mapping_type: java.lang.String
+ passthrough_setting:
+ passthrough_all_headers: true
+ path_matcher:
+ match_http_method_spec: ALL_GET
+ match_pattern: /dubbo/hello
+ name: org.apache.dubbo.samples.gateway.api.DemoService
+ version: 1.0.0
+ url_unescape_spec: ALL_CHARACTERS_EXCEPT_RESERVED
+ - applyTo: CLUSTER
+ match:
+ cluster:
+ service: gateway-higress-dubbo.DEFAULT-GROUP.public.nacos
+ context: GATEWAY
+ patch:
+ operation: MERGE
+ value:
+ upstream_config:
+ name: envoy.upstreams.http.dubbo_tcp
+ typed_config:
+ '@type': type.googleapis.com/udpa.type.v1.TypedStruct
+ type_url: type.googleapis.com/envoy.extensions.upstreams.http.dubbo_tcp.v3.DubboTcpConnectionPoolProto
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/ingress/Ingress-interface-registry.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/ingress/Ingress-interface-registry.yaml
new file mode 100644
index 0000000..13045b4
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/ingress/Ingress-interface-registry.yaml
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ annotations:
+ higress.io/destination: providers:org.apache.dubbo.samples.gateway.api.DemoService:1.0.0:dev.DEFAULT-GROUP.public.nacos
+ name: demo
+ namespace: default
+spec:
+ ingressClassName: higress
+ rules:
+ - http:
+ paths:
+ - backend:
+ resource:
+ apiGroup: networking.higress.io
+ kind: McpBridge
+ name: default
+ path: /org.apache.dubbo.samples.gateway.api.DemoService
+ pathType: Prefix
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/ingress/Ingress.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/ingress/Ingress.yaml
new file mode 100644
index 0000000..a67e156
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/ingress/Ingress.yaml
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ annotations:
+ higress.io/destination: gateway-higress-dubbo.DEFAULT-GROUP.public.nacos
+ name: demo
+ namespace: higress-system
+spec:
+ ingressClassName: higress
+ rules:
+ - http:
+ paths:
+ - backend:
+ resource:
+ apiGroup: networking.higress.io
+ kind: McpBridge
+ name: default
+ path: /dubbo
+ pathType: Prefix
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/mcp/mcpbridge.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/mcp/mcpbridge.yml
new file mode 100644
index 0000000..dde9fff
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/mcp/mcpbridge.yml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+apiVersion: networking.higress.io/v1
+kind: McpBridge
+metadata:
+ name: nacos-service-resource
+ namespace: higress-system
+spec:
+ registries:
+ - domain: nacos-server.default.svc.cluster.local
+ nacosGroups:
+ - DEFAULT_GROUP
+ name: nacos-service-resource
+ port: 8848
+ type: nacos2
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/nacos/Nacos.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/nacos/Nacos.yaml
new file mode 100644
index 0000000..3b3563f
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/nacos/Nacos.yaml
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+kind: Deployment
+apiVersion: apps/v1
+metadata:
+ name: nacos-server
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: nacos-server
+ template:
+ metadata:
+ labels:
+ app: nacos-server
+ spec:
+ containers:
+ - env:
+ - name: MODE
+ value: standalone
+ image: nacos/nacos-server:v2.2.0
+ imagePullPolicy: Always
+ name: nacos-server
+ ports:
+ - containerPort: 8848
+ name: client
+ - containerPort: 9848
+ name: client-rpc
+ - containerPort: 9849
+ name: raft-rpc
+ - containerPort: 7848
+ name: old-raft-rpc
+ dnsPolicy: ClusterFirst
+ restartPolicy: Always
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: nacos-server
+spec:
+ ports:
+ - port: 8848
+ name: server
+ protocol: TCP
+ targetPort: 8848
+ selector:
+ app: nacos-server
+ type: ClusterIP
\ No newline at end of file
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/provider/Deployment.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/provider/Deployment.yaml
new file mode 100644
index 0000000..7931a36
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/deploy/provider/Deployment.yaml
@@ -0,0 +1,42 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: gateway-higress-triple-provider
+ namespace: default
+ labels:
+ app: gateway-higress-triple-provider
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: gateway-higress-triple-provider
+ template:
+ metadata:
+ labels:
+ app: gateway-higress-dubbo-provider
+ spec:
+ containers:
+ - name: gateway-higress-dubbo-provider
+ image: docker.io/allenyi/higress-triple:2.0.0
+ imagePullPolicy: IfNotPresent
+ ports:
+ - containerPort: 20880
+ env:
+ - name: NACOS_ADDRESS
+ value: nacos-server.default.svc.cluster.local
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/pom.xml
new file mode 100644
index 0000000..ec3f604
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-gateway-higress-dubbo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-gateway-higress-dubbo-consumer</artifactId>
+
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-gateway-higress-dubbo-interface</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <!-- dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
+ </dependency>
+
+ <!-- spring starter -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
similarity index 99%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
index 5cac7b9..8e8d69e 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/ConsumerApplication.java
@@ -20,7 +20,6 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-
@SpringBootApplication
@EnableDubbo
public class ConsumerApplication {
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/Task.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/task/Task.java
similarity index 63%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/Task.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/task/Task.java
index aee2034..ba9d431 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/Task.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/java/org/apache/dubbo/samples/gateway/consumer/task/Task.java
@@ -14,35 +14,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.consumer;
+package org.apache.dubbo.samples.gateway.consumer.task;
import org.apache.dubbo.config.annotation.DubboReference;
-import org.apache.dubbo.samples.api.DemoService;
+import org.apache.dubbo.samples.gateway.api.DemoService;
import org.springframework.boot.CommandLineRunner;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import java.util.Date;
+import org.springframework.web.client.RestClient;
@Component
public class Task implements CommandLineRunner {
-
@DubboReference
private DemoService demoService;
@Override
public void run(String... args) throws Exception {
- String result = demoService.sayHello("world");
- System.out.println("Receive result ======> " + result);
-
- new Thread(()-> {
- while (true) {
- try {
- Thread.sleep(1000);
- System.out.println(new Date() + " Receive result ======> " + demoService.sayHello("world"));
- } catch (InterruptedException e) {
- e.printStackTrace();
- Thread.currentThread().interrupt();
- }
- }
- }).start();
+ System.out.println("Receive result ======> " + demoService.sayHello("world"));
}
+
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/resources/application.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/resources/application.yml
new file mode 100644
index 0000000..45e1a2d
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/resources/application.yml
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+dubbo:
+ application:
+ name: gateway-higress-dubbo-consumer
+ logger: slf4j
+ registry:
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
+ consumer:
+ check: false
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/resources/log4j2.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..69e1321
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-consumer/src/main/resources/log4j2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT" follow="true">
+ <PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-interface/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-interface/pom.xml
new file mode 100644
index 0000000..89cdaee
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-interface/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-gateway-higress-dubbo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-gateway-higress-dubbo-interface</artifactId>
+
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <!-- spring web annotation support -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.alibaba.spring</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java
similarity index 94%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java
index 202775d..2a0434b 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-interface/src/main/java/org/apache/dubbo/samples/api/DemoService.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java
@@ -14,10 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.api;
+package org.apache.dubbo.samples.gateway.api;
public interface DemoService {
-
String sayHello(String name);
-
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/Dockerfile b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/Dockerfile
new file mode 100644
index 0000000..9d8b7a8
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/Dockerfile
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+FROM openjdk:17-jre
+ADD dubbo-samples-gateway-higress-dubbo-provider-1.0-SNAPSHOT.jar /dubbo-samples-gateway-higress-dubbo-provider-1.0-SNAPSHOT.jar
+EXPOSE 50052
+CMD java -jar dubbo-samples-gateway-higress-dubbo-provider-1.0-SNAPSHOT.jar
+
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/pom.xml
new file mode 100644
index 0000000..4308254
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-gateway-higress-dubbo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-gateway-higress-dubbo-provider</artifactId>
+
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-gateway-higress-dubbo-interface</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <!-- dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
+ </dependency>
+
+ <!-- spring starter -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
similarity index 95%
rename from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
rename to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
index 6c6f9e8..3249ce5 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/ProviderApplication.java
@@ -24,7 +24,9 @@
@SpringBootApplication
@EnableDubbo
public class ProviderApplication {
+
public static void main(String[] args) {
SpringApplication.run(ProviderApplication.class, args);
+ System.out.println("dubbo service started");
}
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/impl/DemoServiceImpl.java
similarity index 88%
copy from 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java
copy to 2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/impl/DemoServiceImpl.java
index e875f4d..a4573d0 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-apisix/dubbo-samples-gateway-apisix-dubbo/dubbo-samples-gateway-apisix-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/DemoServiceImpl.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/java/org/apache/dubbo/samples/gateway/provider/impl/DemoServiceImpl.java
@@ -14,15 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.samples.gateway.provider;
+package org.apache.dubbo.samples.gateway.provider.impl;
import org.apache.dubbo.config.annotation.DubboService;
-import org.apache.dubbo.samples.api.DemoService;
-
+import org.apache.dubbo.samples.gateway.api.DemoService;
@DubboService
public class DemoServiceImpl implements DemoService {
+
+ @Override
public String sayHello(String name) {
return "Hello " + name;
}
+
}
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/resources/application.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/resources/application.yml
new file mode 100644
index 0000000..80fba90
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/resources/application.yml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+server:
+ port: 8080
+dubbo:
+ application:
+ logger: slf4j
+ name: gateway-higress-dubbo-provider
+ qos-port: 33333
+ registry:
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
+ protocol:
+ name: dubbo
+ port: 20880
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/resources/log4j2.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..69e1321
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/dubbo-samples-gateway-higress-dubbo-provider/src/main/resources/log4j2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT" follow="true">
+ <PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/pom.xml
new file mode 100644
index 0000000..88022dc
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-dubbo/pom.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>pom</packaging>
+
+ <artifactId>dubbo-samples-gateway-higress-dubbo</artifactId>
+
+ <modules>
+ <module>dubbo-samples-gateway-higress-dubbo-interface</module>
+ <module>dubbo-samples-gateway-higress-dubbo-provider</module>
+ <module>dubbo-samples-gateway-higress-dubbo-consumer</module>
+ </modules>
+
+ <properties>
+ <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.3.0-beta.2</dubbo.version>
+ <log4j2.version>2.20.0</log4j2.version>
+ <junit.version>4.13.1</junit.version>
+ <spring.version>6.1.5</spring.version>
+ <spring-context-support.verison>1.0.11</spring-context-support.verison>
+ <spring-boot.version>3.2.3</spring-boot.version>
+
+ <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-framework-bom</artifactId>
+ <version>${spring.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring-boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-bom</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgs>
+ <compilerArg>-proc:none</compilerArg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/README.md b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/README.md
new file mode 100644
index 0000000..1e0019b
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/README.md
@@ -0,0 +1 @@
+Please visit [the official website](http://dubbo-nexe.apache.org/zh-cn/overview/mannual/java-sdk/tasks/gateway/triple/) for more details of this example.
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/ingress/Ingress.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/ingress/Ingress.yaml
index 92eb804..5bd96c9 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/ingress/Ingress.yaml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/ingress/Ingress.yaml
@@ -17,10 +17,10 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
- annotations:
- higress.io/destination: providers:org.apache.dubbo.samples.gateway.api.DemoService::.DEFAULT-GROUP.public.nacos
- name: higress-triple-demo
- namespace: higress-system
+ annotations:
+ higress.io/destination: gateway-higress-triple-provider.DEFAULT-GROUP.public.nacos
+ name: demo
+ namespace: default
spec:
ingressClassName: higress
rules:
@@ -31,5 +31,5 @@
apiGroup: networking.higress.io
kind: McpBridge
name: default
- path: /demo
+ path: /org.apache.dubbo.samples.gateway.api.DemoService
pathType: Prefix
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/mcp/mcpbridge.yml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/mcp/mcpbridge.yml
new file mode 100644
index 0000000..dde9fff
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/mcp/mcpbridge.yml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+apiVersion: networking.higress.io/v1
+kind: McpBridge
+metadata:
+ name: nacos-service-resource
+ namespace: higress-system
+spec:
+ registries:
+ - domain: nacos-server.default.svc.cluster.local
+ nacosGroups:
+ - DEFAULT_GROUP
+ name: nacos-service-resource
+ port: 8848
+ type: nacos2
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/nacos/Nacos.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/nacos/Nacos.yaml
new file mode 100644
index 0000000..3b3563f
--- /dev/null
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/nacos/Nacos.yaml
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+kind: Deployment
+apiVersion: apps/v1
+metadata:
+ name: nacos-server
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: nacos-server
+ template:
+ metadata:
+ labels:
+ app: nacos-server
+ spec:
+ containers:
+ - env:
+ - name: MODE
+ value: standalone
+ image: nacos/nacos-server:v2.2.0
+ imagePullPolicy: Always
+ name: nacos-server
+ ports:
+ - containerPort: 8848
+ name: client
+ - containerPort: 9848
+ name: client-rpc
+ - containerPort: 9849
+ name: raft-rpc
+ - containerPort: 7848
+ name: old-raft-rpc
+ dnsPolicy: ClusterFirst
+ restartPolicy: Always
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: nacos-server
+spec:
+ ports:
+ - port: 8848
+ name: server
+ protocol: TCP
+ targetPort: 8848
+ selector:
+ app: nacos-server
+ type: ClusterIP
\ No newline at end of file
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/provider/Deployment.yaml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/provider/Deployment.yaml
index 1d2f0b2..ceb08fe 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/provider/Deployment.yaml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/provider/Deployment.yaml
@@ -36,7 +36,7 @@
image: docker.io/allenyi/higress-triple:2.0.0
imagePullPolicy: IfNotPresent
ports:
- - containerPort: 20880
+ - containerPort: 50052
env:
- name: NACOS_ADDRESS
value: nacos-server.default.svc.cluster.local
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-consumer/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-consumer/pom.xml
index d19472f..9459eec 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-consumer/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-consumer/pom.xml
@@ -47,6 +47,10 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
+ </dependency>
<!-- spring starter -->
<dependency>
@@ -65,6 +69,14 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java
index 39ab935..0825203 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-interface/src/main/java/org/apache/dubbo/samples/gateway/api/DemoService.java
@@ -20,7 +20,7 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-@RequestMapping("/demo")
+@RequestMapping("/triple/demo")
public interface DemoService {
@RequestMapping(method = RequestMethod.GET, value = "/hello")
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-provider/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-provider/pom.xml
index dbe131c..2607d29 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-provider/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/dubbo-samples-gateway-higress-triple-provider/pom.xml
@@ -47,6 +47,10 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
+ </dependency>
<!-- spring starter -->
<dependency>
@@ -65,6 +69,14 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/pom.xml
index b81c42d..3e282a9 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/pom.xml
@@ -39,8 +39,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dubbo.version>3.3.0-beta.2-SNAPSHOT</dubbo.version>
- <dubbo-nacos.version>3.3.0-beta.1</dubbo-nacos.version>
+ <dubbo.version>3.3.0-beta.2</dubbo.version>
<log4j2.version>2.20.0</log4j2.version>
<junit.version>4.13.1</junit.version>
<spring.version>6.1.5</spring.version>
@@ -88,43 +87,6 @@
</dependencies>
</dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <version>${dubbo-nacos.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-common</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j2.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-framework-bom</artifactId>
- <version>${spring.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
-
<build>
<plugins>
<plugin>
diff --git a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/pom.xml b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/pom.xml
index 2a5b419..b303842 100644
--- a/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/pom.xml
@@ -30,6 +30,7 @@
<artifactId>dubbo-samples-gateway-higress</artifactId>
<modules>
+ <module>dubbo-samples-gateway-higress-dubbo</module>
<module>dubbo-samples-gateway-higress-triple</module>
</modules>
diff --git a/2-advanced/dubbo-samples-gateway/pom.xml b/2-advanced/dubbo-samples-gateway/pom.xml
index 0ac1c24..cabbf07 100644
--- a/2-advanced/dubbo-samples-gateway/pom.xml
+++ b/2-advanced/dubbo-samples-gateway/pom.xml
@@ -31,8 +31,8 @@
<description>Dubbo Samples Gateway</description>
<modules>
- <module>dubbo-samples-gateway-apisix</module>
<module>dubbo-samples-gateway-higress</module>
+ <module>dubbo-samples-gateway-apisix</module>
</modules>
<repositories>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-registry/pom.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-registry/pom.xml
index 1f44cbe..d5afa37 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-registry/pom.xml
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-registry/pom.xml
@@ -39,6 +39,7 @@
<junit.version>4.13.1</junit.version>
<nacos.version>2.1.2</nacos.version>
+ <spring-boot.version>3.2.3</spring-boot.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
</properties>
@@ -46,13 +47,23 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-framework-bom</artifactId>
- <version>${spring.version}</version>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
@@ -60,76 +71,47 @@
<type>pom</type>
<scope>import</scope>
</dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
+
+ <!-- dubbo -->
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency>
+ <!-- spring starter -->
<dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-configcenter-nacos</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <exclusions>
- <exclusion>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j2.version}</version>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
</dependency>
-
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>${nacos.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>simpleclient</artifactId>
- <groupId>io.prometheus</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <artifactId>simpleclient</artifactId>
- <groupId>io.prometheus</groupId>
- <version>0.16.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
+ <version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/3-extensions/registry/dubbo-samples-zookeeper/pom.xml b/3-extensions/registry/dubbo-samples-zookeeper/pom.xml
index 9110359..85d7ed9 100644
--- a/3-extensions/registry/dubbo-samples-zookeeper/pom.xml
+++ b/3-extensions/registry/dubbo-samples-zookeeper/pom.xml
@@ -33,7 +33,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dubbo.version>3.3.0-beta.1</dubbo.version>
+ <dubbo.version>3.3.0-beta.2</dubbo.version>
<spring-boot.version>3.2.3</spring-boot.version>
<junit5.version>5.10.1</junit5.version>