This is an automated email from the ASF dual-hosted git repository.
hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 640ce64c8 [Task] add alibaba dubbo sdk example and integrated test
(#3925) (#4181)
640ce64c8 is described below
commit 640ce64c8e8f9a9e6fdf2384d221e6e928266edf
Author: mahaitao <[email protected]>
AuthorDate: Mon Nov 14 10:04:15 2022 +0800
[Task] add alibaba dubbo sdk example and integrated test (#3925) (#4181)
* feat:add alibaba example
* feat:add alibaba dubbo sdk example
* feat:fix checkstyle
* feat:fix
Co-authored-by: mahaitao617 <[email protected]>
---
.../shenyu-examples-sdk-dubbo/pom.xml | 2 +
.../Dockerfile | 29 ++++
.../pom.xml | 105 ++++----------
.../src/main/http/sdk-alibaba-dubbo-test-api.http | 24 ++++
.../ShenyuSdkAlibabaDubboExampleApplication.java | 39 ++++++
.../consumer/api/ShenyuAlibabaDubboClientApi.java | 38 ++++++
.../ShenyuAlibabaDubboSdkExampleController.java | 45 ++++++
.../src/main/resources/application.yml | 56 ++++++++
.../Dockerfile | 30 ++++
.../pom.xml | 84 ++----------
.../src/main/http/sdk-alibaba-dubbo-test-api.http | 24 ++++
.../ShenyuSdkAlibabaDubboProviderApplication.java | 41 ++++++
.../src/main/resources/application.yml | 38 ++++++
.../src/main/resources/spring-dubbo.xml | 40 ++++++
.../pom.xml | 2 +-
shenyu-integrated-test/pom.xml | 1 +
.../Dockerfile | 29 ++++
.../docker-compose.yml | 111 +++++++++++++++
.../pom.xml | 146 ++++++++------------
.../script/healthcheck.sh | 36 +++++
.../script/services.list | 20 +++
.../dubbo/SdkAlibabaDubboIntegratedBootstrap.java | 37 +++++
.../src/main/resources/application.yml | 152 +++++++++++++++++++++
.../test/alibaba/dubbo/ApacheDubboPluginTest.java | 46 +++++++
24 files changed, 933 insertions(+), 242 deletions(-)
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/pom.xml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/pom.xml
index 20cac6bbc..43a36f4c4 100644
--- a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/pom.xml
+++ b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/pom.xml
@@ -31,6 +31,8 @@
<modules>
<module>shenyu-examples-sdk-apache-dubbo-consumer</module>
<module>shenyu-examples-sdk-apache-dubbo-provider</module>
+ <module>shenyu-examples-sdk-alibaba-dubbo-provider</module>
+ <module>shenyu-examples-sdk-alibaba-dubbo-consumer</module>
</modules>
<dependencyManagement>
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/Dockerfile
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/Dockerfile
new file mode 100644
index 000000000..f346f48a1
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/Dockerfile
@@ -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.
+
+FROM openjdk:8-jre-alpine
+
+ENV APP_NAME shenyu-examples-sdk-alibaba-dubbo-consumer
+ENV LOCAL_PATH /opt/${APP_NAME}
+
+RUN mkdir -p ${LOCAL_PATH}
+
+ADD target/${APP_NAME}.jar ${LOCAL_PATH}
+
+WORKDIR ${LOCAL_PATH}
+EXPOSE 8899
+
+CMD java -jar ${APP_NAME}.jar
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/pom.xml
similarity index 52%
copy from
shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
copy to
shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/pom.xml
index 52b62658e..9ba4cc52b 100644
---
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/pom.xml
@@ -15,135 +15,79 @@
~ 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
https://maven.apache.org/xsd/maven-4.0.0.xsd">
+<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">
<parent>
- <groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-examples-sdk-dubbo</artifactId>
+ <groupId>org.apache.shenyu</groupId>
<version>2.5.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-examples-sdk-apache-dubbo-provider</artifactId>
- <properties>
- <curator.version>5.2.1</curator.version>
- <nacos-client.version>2.0.4</nacos-client.version>
- <apache.dubbo.version>2.7.15</apache.dubbo.version>
- <zookeeper.version>3.6.3</zookeeper.version>
- </properties>
+ <artifactId>shenyu-examples-sdk-alibaba-dubbo-consumer</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-client-apache-dubbo</artifactId>
- <version>${project.version}</version>
+ <artifactId>shenyu-sdk-core</artifactId>
</dependency>
-
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-dubbo-api</artifactId>
+ <version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
+
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-examples-common</artifactId>
+ <artifactId>shenyu-sdk-httpclient</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-configuration-processor</artifactId>
- <optional>true</optional>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
</dependency>
+ <!--spring bootstrap-->
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-autoconfigure</artifactId>
+ <artifactId>spring-boot-starter</artifactId>
</dependency>
- <!-- Dubbo dependency -->
<dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <version>${apache.dubbo.version}</version>
- </dependency>
-
- <!--
https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-registry-nacos -->
- <!-- Dubbo Nacos registry dependency -->
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <version>${apache.dubbo.version}</version>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-examples-apache-dubbo-service-xml</artifactId>
- <version>2.5.1-SNAPSHOT</version>
- </dependency>
-
- <!-- Keep latest Nacos client version -->
- <dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>${nacos-client.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-client</artifactId>
- <version>${curator.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>${curator.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
- <version>${curator.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>${zookeeper.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
+ <artifactId>shenyu-spring-boot-starter-sdk</artifactId>
</dependency>
</dependencies>
<build>
- <finalName>shenyu-examples-sdk-apache-dubbo-provider</finalName>
+ <finalName>shenyu-examples-sdk-alibaba-dubbo-consumer</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
-
<mainClass>org.apache.shenyu.examples.sdk.apache.provider.ShenyuApacheDubboXmlProviderApplication</mainClass>
+
<mainClass>org.apache.shenyu.examples.sdk.alibaba.dubbo.consumer.ShenyuSdkAlibabaDubboExampleApplication</mainClass>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
-
<profiles>
<profile>
<id>example</id>
<properties>
-
<docker.buildArg.APP_NAME>shenyu-examples-sdk-apache-dubbo-provider</docker.buildArg.APP_NAME>
-
<docker.image.tag.repo>shenyu-examples-sdk-apache-dubbo-provider</docker.image.tag.repo>
+
<docker.buildArg.APP_NAME>shenyu-examples-sdk-alibaba-dubbo-consumer</docker.buildArg.APP_NAME>
+
<docker.image.tag.repo>shenyu-examples-sdk-alibaba-dubbo-consumer</docker.image.tag.repo>
<docker.image.tag.tagName>latest</docker.image.tag.tagName>
</properties>
<activation>
@@ -158,7 +102,7 @@
<configuration>
<images>
<image>
-
<name>shenyu-examples-sdk-apache-dubbo-provider</name>
+
<name>shenyu-examples-sdk-alibaba-dubbo-consumer</name>
<build>
<contextDir>${project.basedir}</contextDir>
</build>
@@ -178,5 +122,4 @@
</build>
</profile>
</profiles>
-
</project>
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/http/sdk-alibaba-dubbo-test-api.http
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/http/sdk-alibaba-dubbo-test-api.http
new file mode 100644
index 000000000..a513a0128
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/http/sdk-alibaba-dubbo-test-api.http
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+
+### shengyu alibaba dubbo /sdk/dubbo/findAll
+GET http://localhost:8899/sdk/dubbo/findAll
+Accept: application/json
+Content-Type: application/json
+
+
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/ShenyuSdkAlibabaDubboExampleApplication.java
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/ShenyuSdkAlibabaDubboExampleApplication.java
new file mode 100644
index 000000000..8572644d0
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/ShenyuSdkAlibabaDubboExampleApplication.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.examples.sdk.alibaba.dubbo.consumer;
+
+import org.apache.shenyu.sdk.spring.EnableShenyuClients;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * ShenyuSdkAlibabaDubboExampleApplication.
+ */
+@SpringBootApplication
+@EnableShenyuClients(basePackages =
"org.apache.shenyu.examples.sdk.alibaba.dubbo.consumer.api")
+public class ShenyuSdkAlibabaDubboExampleApplication {
+
+ /**
+ * main.
+ *
+ * @param args args
+ */
+ public static void main(final String[] args) {
+ SpringApplication.run(ShenyuSdkAlibabaDubboExampleApplication.class,
args);
+ }
+}
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/api/ShenyuAlibabaDubboClientApi.java
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/api/ShenyuAlibabaDubboClientApi.java
new file mode 100644
index 000000000..fad74d388
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/api/ShenyuAlibabaDubboClientApi.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.examples.sdk.alibaba.dubbo.consumer.api;
+
+import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
+import org.apache.shenyu.sdk.spring.ShenyuClient;
+import org.springframework.web.bind.annotation.GetMapping;
+
+/**
+ * ShenyuApacheDubboClientApi.
+ */
+@ShenyuClient(contextId = "shenyu-gateway", name = "ShenyuSdkApiName")
+public interface ShenyuAlibabaDubboClientApi {
+
+ /**
+ * findAll.
+ * test Get.
+ * @return SdkTestDto
+ */
+ @GetMapping("/dubbo/findAll")
+ DubboTest findAll();
+
+}
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/controller/ShenyuAlibabaDubboSdkExampleController.java
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/controller/ShenyuAlibabaDubboSdkExampleController.java
new file mode 100644
index 000000000..25bff3989
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/java/org/apache/shenyu/examples/sdk/alibaba/dubbo/consumer/controller/ShenyuAlibabaDubboSdkExampleController.java
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.examples.sdk.alibaba.dubbo.consumer.controller;
+
+import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
+import
org.apache.shenyu.examples.sdk.alibaba.dubbo.consumer.api.ShenyuAlibabaDubboClientApi;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * ShenyuHttpSdkExampleController.
+ * invoke shenyuSdkAPi
+ */
+@RestController
+public class ShenyuAlibabaDubboSdkExampleController {
+
+ @Autowired
+ private ShenyuAlibabaDubboClientApi shenyuApacheDubboClientApi;
+
+ /**
+ * findAll.
+ * @return SdkTestDto
+ */
+ @GetMapping("/sdk/dubbo/findAll")
+ public DubboTest findAll() {
+ return shenyuApacheDubboClientApi.findAll();
+ }
+
+}
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/resources/application.yml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/resources/application.yml
new file mode 100644
index 000000000..f9f08ad0e
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-consumer/src/main/resources/application.yml
@@ -0,0 +1,56 @@
+# 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: 8899
+ address: 0.0.0.0
+ tomcat:
+ max-http-form-post-size: 100MB
+
+shenyu:
+ register:
+ registerType: http #zookeeper #etcd #nacos #consul
+ serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379
#localhost:8848
+ props:
+ username: admin
+ password: 123456
+ client:
+ dubbo:
+ props:
+ contextPath: /http
+ appName: http
+
+ sdk:
+ enabled: true
+ register-type: zookeeper #local #etcd #nacos #consul
+ server-lists: localhost:2181 #http://localhost:9095 #http://localhost:2379
#localhost:8848
+
+spring:
+ servlet:
+ multipart:
+ max-file-size: 100MB
+ max-request-size: 100MB
+management:
+ endpoint:
+ health:
+ enabled: true
+
+logging:
+ level:
+ root: info
+ org.springframework.boot: info
+ org.apache.ibatis: info
+ org.apache.shenyu.test.bonuspoint: info
+ org.apache.shenyu.test.lottery: debug
+ org.apache.shenyu.test: debug
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/Dockerfile
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/Dockerfile
new file mode 100644
index 000000000..05737e3d9
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/Dockerfile
@@ -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.
+
+FROM openjdk:8-jre-alpine
+
+ENV APP_NAME shenyu-examples-sdk-alibaba-dubbo-provider
+ENV LOCAL_PATH /opt/${APP_NAME}
+
+RUN mkdir -p ${LOCAL_PATH}
+
+ADD target/${APP_NAME}.jar ${LOCAL_PATH}
+
+WORKDIR ${LOCAL_PATH}
+EXPOSE 8011
+EXPOSE 20888
+
+CMD java -jar ${APP_NAME}.jar
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/pom.xml
similarity index 60%
copy from
shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
copy to
shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/pom.xml
index 52b62658e..755592363 100644
---
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/pom.xml
@@ -24,22 +24,26 @@
<version>2.5.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-examples-sdk-apache-dubbo-provider</artifactId>
+ <artifactId>shenyu-examples-sdk-alibaba-dubbo-provider</artifactId>
<properties>
<curator.version>5.2.1</curator.version>
<nacos-client.version>2.0.4</nacos-client.version>
- <apache.dubbo.version>2.7.15</apache.dubbo.version>
+ <alibaba.dubbo.version>2.6.5</alibaba.dubbo.version>
<zookeeper.version>3.6.3</zookeeper.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-client-apache-dubbo</artifactId>
+ <artifactId>shenyu-client-alibaba-dubbo</artifactId>
<version>${project.version}</version>
</dependency>
-
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>dubbo</artifactId>
+ <version>${alibaba.dubbo.version}</version>
+ </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
@@ -58,80 +62,22 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-autoconfigure</artifactId>
- </dependency>
-
- <!-- Dubbo dependency -->
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <version>${apache.dubbo.version}</version>
- </dependency>
-
- <!--
https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-registry-nacos -->
- <!-- Dubbo Nacos registry dependency -->
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <version>${apache.dubbo.version}</version>
- </dependency>
-
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-examples-apache-dubbo-service-xml</artifactId>
- <version>2.5.1-SNAPSHOT</version>
- </dependency>
-
- <!-- Keep latest Nacos client version -->
- <dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>${nacos-client.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-client</artifactId>
- <version>${curator.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>${curator.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
- <version>${curator.version}</version>
+ <artifactId>shenyu-examples-alibaba-dubbo-service</artifactId>
+ <version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>${zookeeper.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
</dependencies>
<build>
- <finalName>shenyu-examples-sdk-apache-dubbo-provider</finalName>
+ <finalName>shenyu-examples-sdk-alibaba-dubbo-provider</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
-
<mainClass>org.apache.shenyu.examples.sdk.apache.provider.ShenyuApacheDubboXmlProviderApplication</mainClass>
+
<mainClass>org.apache.shenyu.examples.sdk.alibaba.provider.ShenyuSdkAlibabaDubboProviderApplication</mainClass>
<executable>true</executable>
</configuration>
</plugin>
@@ -142,8 +88,8 @@
<profile>
<id>example</id>
<properties>
-
<docker.buildArg.APP_NAME>shenyu-examples-sdk-apache-dubbo-provider</docker.buildArg.APP_NAME>
-
<docker.image.tag.repo>shenyu-examples-sdk-apache-dubbo-provider</docker.image.tag.repo>
+
<docker.buildArg.APP_NAME>shenyu-examples-sdk-alibaba-dubbo-provider</docker.buildArg.APP_NAME>
+
<docker.image.tag.repo>shenyu-examples-sdk-alibaba-dubbo-provider</docker.image.tag.repo>
<docker.image.tag.tagName>latest</docker.image.tag.tagName>
</properties>
<activation>
@@ -158,7 +104,7 @@
<configuration>
<images>
<image>
-
<name>shenyu-examples-sdk-apache-dubbo-provider</name>
+
<name>shenyu-examples-sdk-alibaba-dubbo-provider</name>
<build>
<contextDir>${project.basedir}</contextDir>
</build>
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/http/sdk-alibaba-dubbo-test-api.http
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/http/sdk-alibaba-dubbo-test-api.http
new file mode 100644
index 000000000..a513a0128
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/http/sdk-alibaba-dubbo-test-api.http
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+
+### shengyu alibaba dubbo /sdk/dubbo/findAll
+GET http://localhost:8899/sdk/dubbo/findAll
+Accept: application/json
+Content-Type: application/json
+
+
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/java/org/apache/shenyu/examples/sdk/alibaba/provider/ShenyuSdkAlibabaDubboProviderApplication.java
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/java/org/apache/shenyu/examples/sdk/alibaba/provider/ShenyuSdkAlibabaDubboProviderApplication.java
new file mode 100644
index 000000000..cffec5c3f
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/java/org/apache/shenyu/examples/sdk/alibaba/provider/ShenyuSdkAlibabaDubboProviderApplication.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.examples.sdk.alibaba.provider;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ImportResource;
+
+/**
+ * ShenyuAlibabaDubboProviderApplication.
+ */
+@SpringBootApplication
+@ImportResource("classpath:spring-dubbo.xml")
+@ComponentScan(basePackages =
"org.apache.shenyu.examples.alibaba.dubbo.service.impl")
+public class ShenyuSdkAlibabaDubboProviderApplication {
+
+ /**
+ * main.
+ *
+ * @param args args
+ */
+ public static void main(final String[] args) {
+ SpringApplication.run(ShenyuSdkAlibabaDubboProviderApplication.class,
args);
+ }
+}
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/resources/application.yml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/resources/application.yml
new file mode 100644
index 000000000..f43880d25
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/resources/application.yml
@@ -0,0 +1,38 @@
+# 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: 8011
+ address: 0.0.0.0
+ servlet:
+ context-path: /
+spring:
+ main:
+ allow-bean-definition-overriding: true
+dubbo:
+ zk: zookeeper://localhost:2181
+
+shenyu:
+ register:
+ registerType: http #zookeeper #etcd #nacos #consul
+ serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379
#localhost:8848
+ props:
+ username: admin
+ password: 123456
+ client:
+ dubbo:
+ props:
+ contextPath: /dubbo
+ appName: dubbo
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/resources/spring-dubbo.xml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/resources/spring-dubbo.xml
new file mode 100644
index 000000000..426684189
--- /dev/null
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-alibaba-dubbo-provider/src/main/resources/spring-dubbo.xml
@@ -0,0 +1,40 @@
+<?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.
+ -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://code.alibabatech.com/schema/dubbo
+ https://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+
+ <dubbo:application name="test-dubbo-service"/>
+
+ <dubbo:registry address="${dubbo.zk}"/>
+
+ <dubbo:protocol name="dubbo" port="20888"/>
+
+ <dubbo:service timeout="10000"
interface="org.apache.shenyu.examples.dubbo.api.service.DubboTestService"
ref="dubboTestService"/>
+
+ <dubbo:service timeout="10000"
interface="org.apache.shenyu.examples.dubbo.api.service.DubboMultiParamService"
ref="dubboMultiParamService"/>
+
+ <dubbo:service timeout="10000"
interface="org.apache.shenyu.examples.dubbo.api.service.DubboClassTestService"
ref="dubboClassTestService"/>
+
+ <dubbo:service timeout="10000"
interface="org.apache.shenyu.examples.dubbo.api.service.DubboClassMultiParamService"
ref="dubboClassMultiParamService"/>
+</beans>
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
index 52b62658e..649f66246 100644
---
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
+++
b/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
@@ -81,7 +81,7 @@
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-examples-apache-dubbo-service-xml</artifactId>
- <version>2.5.1-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<!-- Keep latest Nacos client version -->
diff --git a/shenyu-integrated-test/pom.xml b/shenyu-integrated-test/pom.xml
index 3161f9802..e813a7a39 100644
--- a/shenyu-integrated-test/pom.xml
+++ b/shenyu-integrated-test/pom.xml
@@ -41,6 +41,7 @@
<module>shenyu-integrated-test-websocket</module>
<module>shenyu-integrated-test-combination</module>
<module>shenyu-integrated-test-sdk-apache-dubbo</module>
+ <module>shenyu-integrated-test-sdk-alibaba-dubbo</module>
</modules>
<properties>
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/Dockerfile
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/Dockerfile
new file mode 100644
index 000000000..6c66232cf
--- /dev/null
+++ b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/Dockerfile
@@ -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.
+
+FROM openjdk:8-jre-alpine
+
+ENV APP_NAME shenyu-integrated-test-sdk-alibaba-dubbo
+ENV LOCAL_PATH /opt/${APP_NAME}
+
+RUN mkdir -p ${LOCAL_PATH}
+
+ADD target/${APP_NAME}.jar ${LOCAL_PATH}
+
+WORKDIR ${LOCAL_PATH}
+EXPOSE 9195
+
+CMD java -jar ${APP_NAME}.jar
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/docker-compose.yml
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/docker-compose.yml
new file mode 100644
index 000000000..a0ed410e6
--- /dev/null
+++
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/docker-compose.yml
@@ -0,0 +1,111 @@
+# 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.9"
+services:
+ shenyu-zk:
+ container_name: shenyu-zk
+ image: zookeeper:3.5
+ restart: always
+ networks:
+ - shenyu
+ ports:
+ - "2181:2181"
+
+ shenyu-admin:
+ image: apache/shenyu-admin:latest
+ container_name: shenyu-admin
+ restart: always
+ networks:
+ - shenyu
+ ports:
+ - "9095:9095"
+ environment:
+ - SPRING_PROFILES_ACTIVE=h2
+ - shenyu.database.init_script=sql-script/h2/schema.sql
+ healthcheck:
+ test: ["CMD-SHELL", "wget -q -O -
http://shenyu-admin:9095/actuator/health | grep UP || exit 1"]
+ timeout: 2s
+ retries: 3
+ start_period: 5s
+ shenyu-examples-sdk-alibaba-dubbo-provider:
+ deploy:
+ resources:
+ limits:
+ memory: 2048M
+ container_name: shenyu-examples-sdk-alibaba-dubbo-provider
+ image: shenyu-examples-sdk-alibaba-dubbo-provider:latest
+ restart: always
+ healthcheck:
+ test: ["CMD-SHELL", "wget -q -O - http://localhost:8011/actuator/health
| grep UP || exit 1"]
+ timeout: 2s
+ retries: 3
+ start_period: 5s
+ ports:
+ - "8011:8011"
+ - "20888:20888"
+ networks:
+ - shenyu
+ environment:
+ - dubbo.registry.address=zookeeper://shenyu-zk:2181
+ - shenyu.register.serverLists=http://shenyu-admin:9095
+
+ shenyu-examples-sdk-alibaba-dubbo-consumer:
+ deploy:
+ resources:
+ limits:
+ memory: 2048M
+ container_name: shenyu-examples-sdk-alibaba-dubbo-consumer
+ image: shenyu-examples-sdk-alibaba-dubbo-consumer:latest
+ restart: always
+ healthcheck:
+ test: ["CMD-SHELL", "wget -q -O - http://localhost:8899/actuator/health
| grep UP || exit 1"]
+ timeout: 2s
+ retries: 3
+ start_period: 5s
+ ports:
+ - "8899:8899"
+ networks:
+ - shenyu
+ environment:
+ - shenyu.register.serverLists=http://shenyu-admin:9095
+
+ shenyu-integrated-test-sdk-alibaba-dubbo:
+ container_name: shenyu-integrated-test-sdk-alibaba-dubbo
+ image: apache/shenyu-integrated-test-sdk-alibaba-dubbo:latest
+ restart: always
+ deploy:
+ resources:
+ limits:
+ memory: 2048M
+ environment:
+ - dubbo.registry.address=zookeeper://shenyu-zk:2181
+ - shenyu.sync.websocket.urls=ws://shenyu-admin:9095/websocket
+ depends_on:
+ shenyu-admin:
+ condition: service_healthy
+ ports:
+ - "9195:9195"
+ healthcheck:
+ test: [ "CMD", "wget", "-q", "-O", "-",
"http://shenyu-integrated-test-sdk-alibaba-dubbo:9195/actuator/health" ]
+ timeout: 2s
+ retries: 3
+ start_period: 5s
+ networks:
+ - shenyu
+
+networks:
+ shenyu:
+ name: shenyu
diff --git
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/pom.xml
similarity index 50%
copy from
shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
copy to shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/pom.xml
index 52b62658e..98cb4c678 100644
---
a/shenyu-examples/shenyu-examples-sdk/shenyu-examples-sdk-dubbo/shenyu-examples-sdk-apache-dubbo-provider/pom.xml
+++ b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/pom.xml
@@ -15,142 +15,107 @@
~ 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
https://maven.apache.org/xsd/maven-4.0.0.xsd">
+<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">
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-examples-sdk-dubbo</artifactId>
+ <artifactId>shenyu-integrated-test</artifactId>
<version>2.5.1-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-examples-sdk-apache-dubbo-provider</artifactId>
- <properties>
- <curator.version>5.2.1</curator.version>
- <nacos-client.version>2.0.4</nacos-client.version>
- <apache.dubbo.version>2.7.15</apache.dubbo.version>
- <zookeeper.version>3.6.3</zookeeper.version>
- </properties>
+ <artifactId>shenyu-integrated-test-sdk-alibaba-dubbo</artifactId>
+ <name>shenyu-integrated-test-sdk-alibaba-dubbo</name>
<dependencies>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-client-apache-dubbo</artifactId>
+ <artifactId>shenyu-integrated-test-common</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-examples-common</artifactId>
+ <artifactId>shenyu-spring-boot-starter-instance</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-configuration-processor</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-autoconfigure</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-gateway</artifactId>
+ <version>${project.version}</version>
</dependency>
- <!-- Dubbo dependency -->
<dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo</artifactId>
- <version>${apache.dubbo.version}</version>
+ <groupId>org.apache.shenyu</groupId>
+
<artifactId>shenyu-spring-boot-starter-plugin-apache-dubbo</artifactId>
+ <version>${project.version}</version>
</dependency>
-
- <!--
https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-registry-nacos -->
- <!-- Dubbo Nacos registry dependency -->
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <version>${apache.dubbo.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-examples-apache-dubbo-service-xml</artifactId>
- <version>2.5.1-SNAPSHOT</version>
+ <artifactId>dubbo</artifactId>
+ <version>3.1.1</version>
</dependency>
- <!-- Keep latest Nacos client version -->
<dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>${nacos-client.version}</version>
+ <groupId>org.apache.curator</groupId>
+ <artifactId>curator-x-discovery</artifactId>
+ <version>5.1.0</version>
</dependency>
-
+ <!-- Dubbo zookeeper registry dependency start -->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
- <version>${curator.version}</version>
+ <version>4.0.1</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
- <version>${curator.version}</version>
+ <version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
- <version>${curator.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.zookeeper</groupId>
- <artifactId>zookeeper</artifactId>
- <version>${zookeeper.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
+ <version>4.0.1</version>
</dependency>
</dependencies>
-
- <build>
- <finalName>shenyu-examples-sdk-apache-dubbo-provider</finalName>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
-
<mainClass>org.apache.shenyu.examples.sdk.apache.provider.ShenyuApacheDubboXmlProviderApplication</mainClass>
- <executable>true</executable>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
+
<profiles>
<profile>
- <id>example</id>
+ <id>it</id>
<properties>
-
<docker.buildArg.APP_NAME>shenyu-examples-sdk-apache-dubbo-provider</docker.buildArg.APP_NAME>
-
<docker.image.tag.repo>shenyu-examples-sdk-apache-dubbo-provider</docker.image.tag.repo>
+
<docker.buildArg.APP_NAME>shenyu-integrated-test-sdk-alibaba-dubbo</docker.buildArg.APP_NAME>
+
<docker.image.tag.repo>apache/shenyu-integrated-test-sdk-alibaba-dubbo</docker.image.tag.repo>
<docker.image.tag.tagName>latest</docker.image.tag.tagName>
</properties>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
<build>
+ <finalName>shenyu-integrated-test-sdk-alibaba-dubbo</finalName>
<plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+
<mainClass>org.apache.shenyu.integrated.test.apache.dubbo.SdkAlibabaDubboIntegratedBootstrap
+ </mainClass>
+ <executable>true</executable>
+ </configuration>
+ </plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
@@ -158,7 +123,7 @@
<configuration>
<images>
<image>
-
<name>shenyu-examples-sdk-apache-dubbo-provider</name>
+
<name>apache/shenyu-integrated-test-sdk-alibaba-dubbo</name>
<build>
<contextDir>${project.basedir}</contextDir>
</build>
@@ -178,5 +143,4 @@
</build>
</profile>
</profiles>
-
</project>
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/script/healthcheck.sh
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/script/healthcheck.sh
new file mode 100644
index 000000000..22a76034a
--- /dev/null
+++
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/script/healthcheck.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# 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.
+#
+
+PRGDIR=`dirname "$0"`
+for service in `grep -v -E "^$|^#" ${PRGDIR}/services.list`
+do
+ for loop in `seq 1 30`
+ do
+ status=`curl -o /dev/null -s -w %{http_code} $service`
+ echo -e "curl $service response $status"
+
+ if [ $status -eq 200 ]; then
+ break
+ fi
+
+ sleep 2
+ done
+done
+
+sleep 3
+echo -e "\n-------------------"
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/script/services.list
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/script/services.list
new file mode 100644
index 000000000..19a97d90c
--- /dev/null
+++
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/script/services.list
@@ -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.
+
+http://localhost:9095/actuator/health
+http://localhost:8011/actuator/health
+http://localhost:9195/actuator/health
+http://localhost:8899/actuator/health
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/main/java/org/apache/shenyu/integrated/test/apache/dubbo/SdkAlibabaDubboIntegratedBootstrap.java
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/main/java/org/apache/shenyu/integrated/test/apache/dubbo/SdkAlibabaDubboIntegratedBootstrap.java
new file mode 100644
index 000000000..1a21a611a
--- /dev/null
+++
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/main/java/org/apache/shenyu/integrated/test/apache/dubbo/SdkAlibabaDubboIntegratedBootstrap.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.integrated.test.apache.dubbo;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * The type sdk Alibaba dubbo integrated bootstrap.
+ */
+@SpringBootApplication
+public class SdkAlibabaDubboIntegratedBootstrap {
+
+ /**
+ * The entry point of application.
+ *
+ * @param args the input arguments
+ */
+ public static void main(final String[] args) {
+ SpringApplication.run(SdkAlibabaDubboIntegratedBootstrap.class);
+ }
+}
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/main/resources/application.yml
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/main/resources/application.yml
new file mode 100644
index 000000000..ea8e73bba
--- /dev/null
+++
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/main/resources/application.yml
@@ -0,0 +1,152 @@
+# 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: 9195
+ address: 0.0.0.0
+
+spring:
+ main:
+ allow-bean-definition-overriding: true
+ application:
+ name: shenyu-bootstrap
+
+management:
+ health:
+ defaults:
+ enabled: false
+
+shenyu:
+ matchCache:
+ selectorEnabled: false
+ ruleEnabled: true
+ maxSelectorFreeMemory: 256 # 256MB
+ maxRuleFreeMemory: 256 # 256MB
+ netty:
+ http:
+ # set to false, user can custom the netty tcp server config.
+ webServerFactoryEnabled: true
+ selectCount: 1
+ workerCount: 4
+ accessLog: false
+ serverSocketChannel:
+ soRcvBuf: 87380
+ soBackLog: 128
+ soReuseAddr: false
+ connectTimeoutMillis: 10000
+ writeBufferHighWaterMark: 65536
+ writeBufferLowWaterMark: 32768
+ writeSpinCount: 16
+ autoRead: false
+ allocType: "pooled"
+ messageSizeEstimator: 8
+ singleEventExecutorPerGroup: true
+ socketChannel:
+ soKeepAlive: false
+ soReuseAddr: false
+ soLinger: -1
+ tcpNoDelay: true
+ soRcvBuf: 87380
+ soSndBuf: 16384
+ ipTos: 0
+ allowHalfClosure: false
+ connectTimeoutMillis: 10000
+ writeBufferHighWaterMark: 65536
+ writeBufferLowWaterMark: 32768
+ writeSpinCount: 16
+ autoRead: false
+ allocType: "pooled"
+ messageSizeEstimator: 8
+ singleEventExecutorPerGroup: true
+ register:
+ enabled: true
+ registerType: zookeeper #etcd #consul
+ serverLists: localhost:2181 #http://localhost:2379 #localhost:8848
+ props:
+ cross:
+ enabled: true
+ allowedHeaders:
+ allowedMethods: "*"
+ allowedAnyOrigin: true # the same of Access-Control-Allow-Origin: "*"
+ allowedExpose: ""
+ maxAge: "18000"
+ allowCredentials: true
+
+ switchConfig:
+ local: true
+ file:
+ enabled: true
+ maxSize : 10
+ sync:
+ websocket:
+ urls: ws://localhost:9095/websocket
+ allowOrigin: ws://localhost:9195
+ exclude:
+ enabled: true
+ paths:
+ - /favicon.ico
+ - /actuator/health
+ fallback:
+ enabled: false
+ paths:
+ - /fallback/hystrix
+ - /fallback/resilience4j
+ health:
+ enabled: false
+ paths:
+ - /actuator/health
+ - /health_check
+ extPlugin:
+ path:
+ enabled: true
+ threads: 1
+ scheduleTime: 300
+ scheduleDelay: 30
+ scheduler:
+ enabled: false
+ type: fixed
+ threads: 16
+ upstreamCheck:
+ enabled: false
+ timeout: 3000
+ healthyThreshold: 1
+ unhealthyThreshold: 1
+ interval: 5000
+ printEnabled: true
+ printInterval: 60000
+ ribbon:
+ serverListRefreshInterval: 10000
+ metrics:
+ enabled: false
+ name : prometheus
+ host: 127.0.0.1
+ port: 8090
+ jmxConfig:
+ props:
+ jvm_enabled: true
+ # plugins:
+ # rate-limiter.enabled: false
+ local:
+ enabled: false
+ sha512Key:
"BA3253876AED6BC22D4A6FF53D8406C6AD864195ED144AB5C87621B6C233B548BAEAE6956DF346EC8C17F5EA10F35EE3CBC514797ED7DDD3145464E2A0BAB413"
+
+logging:
+ level:
+ root: info
+ org.springframework.boot: info
+ org.apache.ibatis: info
+ org.apache.shenyu.bonuspoint: info
+ org.apache.shenyu.lottery: info
+ org.apache.shenyu: info
diff --git
a/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/test/java/org/apache/shenyu/integrated/test/alibaba/dubbo/ApacheDubboPluginTest.java
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/test/java/org/apache/shenyu/integrated/test/alibaba/dubbo/ApacheDubboPluginTest.java
new file mode 100644
index 000000000..b9408c2ec
--- /dev/null
+++
b/shenyu-integrated-test/shenyu-integrated-test-sdk-alibaba-dubbo/src/test/java/org/apache/shenyu/integrated/test/alibaba/dubbo/ApacheDubboPluginTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.integrated.test.alibaba.dubbo;
+
+import java.io.IOException;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
+import org.apache.shenyu.integratedtest.common.dto.DubboTest;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class ApacheDubboPluginTest extends AbstractPluginDataInit {
+
+ @BeforeAll
+ public static void setup() throws IOException {
+ String pluginResult = initPlugin(PluginEnum.DUBBO.getName(),
"{\"register\":\"zookeeper://shenyu-zk:2181\"}");
+ assertThat(pluginResult, is("success"));
+ }
+
+ @Test
+ public void testFindAll() throws IOException {
+ DubboTest dubboTest =
HttpHelper.INSTANCE.getHttpService("http://localhost:8899/sdk/dubbo/findAll",
null, DubboTest.class);
+ assertEquals("hello world shenyu Apache, findAll",
dubboTest.getName());
+ }
+
+}