Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
CORE_API_DIR="${RUNNER_TEMP}/shenyu-core-api"
git init "${CORE_API_DIR}"
git -C "${CORE_API_DIR}" remote add origin https://github.com/apache/shenyu.git
git -C "${CORE_API_DIR}" fetch --depth 1 origin 91bd8d0c18fae8a1b297a3a752ab3282643bc7f9
git -C "${CORE_API_DIR}" fetch --depth 1 origin 5aa9517a8fb513c3afaa3606cfe8bfefb32fc5ad
git -C "${CORE_API_DIR}" checkout --detach FETCH_HEAD
"${CORE_API_DIR}/mvnw" -B -ntp -f "${CORE_API_DIR}/pom.xml" -pl shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-common,shenyu-web,shenyu-admin-listener/shenyu-admin-listener-api,shenyu-registry/shenyu-registry-api,shenyu-plugin/shenyu-plugin-global,shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-divide,shenyu-plugin/shenyu-plugin-uri,shenyu-plugin/shenyu-plugin-httpclient,shenyu-plugin/shenyu-plugin-response -am install -DskipTests -Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true -DskipRemoteResources=true
"${CORE_API_DIR}/mvnw" -B -ntp -f "${CORE_API_DIR}/pom.xml" -pl shenyu-infra/shenyu-infra-common,shenyu-sync-data-center/shenyu-sync-data-api,shenyu-registry/shenyu-registry-core,shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-common,shenyu-web,shenyu-admin-listener/shenyu-admin-listener-api,shenyu-registry/shenyu-registry-api,shenyu-plugin/shenyu-plugin-global,shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-divide,shenyu-plugin/shenyu-plugin-uri,shenyu-plugin/shenyu-plugin-httpclient,shenyu-plugin/shenyu-plugin-response -am install -DskipTests -Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true -DskipRemoteResources=true
- name: Prepare original-suite core APIs
run: |
CORE_API_DIR="${RUNNER_TEMP}/shenyu-core-api"
Expand Down Expand Up @@ -112,3 +112,9 @@ jobs:
SHENYU_CORE_SOURCE: "${{ runner.temp }}/shenyu-core-api"
run: bash script/plugin-store/run-broker-original-suites.sh logging-rabbitmq
all
- name: Verify external etcd with full Admin and gateway deployments
env:
SHENYU_CORE_SOURCE: "${{ runner.temp }}/shenyu-core-api"
run: |
bash script/plugin-store/build-etcd-runtime.sh
mvn -B -ntp -pl shenyu-extension/shenyu-extension-etcd/shenyu-spring-boot-starter-sync-data-etcd -am verify -Petcd-e2e -Dapi.version=1.44
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,7 @@ starter plus gateway plus backend end-to-end fixture is not included in this cha
In order of registration, More access companies are welcome to register at [https://github.com/apache/shenyu/issues/68](https://github.com/apache/shenyu/issues/68) (For open source users only) .

All Users : [Known Users](https://shenyu.apache.org/community/user-registration)

### etcd integration

The [etcd extension](shenyu-extension/shenyu-extension-etcd/README.md) owns its admin listener, sync adapter, registry provider, starter and shared client together.
23 changes: 23 additions & 0 deletions examples/etcd/admin/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

shenyu:
sync:
etcd:
url: http://etcd-1:2379,http://etcd-2:2379
sessionTimeout: 30000
connectionTimeout: 30000
websocket:
enabled: false
30 changes: 30 additions & 0 deletions examples/etcd/gateway/application.yml
Original file line number Diff line number Diff line change
@@ -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.

shenyu:
sync:
etcd:
url: http://etcd-1:2379,http://etcd-2:2379
sessionTimeout: 30000
connectionTimeout: 30000
websocket:
urls: false
register:
enabled: true
registerType: etcd
serverLists: http://etcd-1:2379,http://etcd-2:2379
props:
etcdTimeout: "3000"
etcdTTL: "5"
68 changes: 68 additions & 0 deletions examples/etcd/gateway/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.shenyu.examples</groupId>
<artifactId>shenyu-etcd-gateway-runtime</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<shenyu.version>2.7.2-SNAPSHOT</shenyu.version>
<store.version>2.7.1-SNAPSHOT</store.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-sync-data-etcd</artifactId>
<version>${store.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-etcd</artifactId>
<version>${store.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-registry</artifactId>
<version>${shenyu.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-zookeeper</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-etcd</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-nacos</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-eureka</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-kubernetes</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# 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-etcd:
image: rancher/hardened-etcd:v3.5.21-k3s1-build20250910
container_name: shenyu-etcd
command: ["etcd"]
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_ADVERTISE_CLIENT_URLS=http://shenyu-etcd:2379
- TZ=Asia/Shanghai
ports:
- "32379:2379"
- "2380:2380"
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
restart: always
networks:
- shenyu

shenyu-mysql:
image: mysql:8.0
container_name: shenyu-mysql
environment:
- MYSQL_ROOT_PASSWORD=shenyue2e
- MYSQL_USER=shenyue2e
- MYSQL_PASSWORD=shenyue2e
ports:
- "30306:3306"
volumes:
- /tmp/shenyu-e2e/mysql/schema/schema.sql:/docker-entrypoint-initdb.d/schema.sql
healthcheck:
test: [ "CMD", "mysql", "-u", "root", "-pshenyue2e", "-e", "SELECT 1" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
deploy:
resources:
limits:
cpus: '1'
memory: 768M
reservations:
cpus: '0.5'
memory: 512M
restart: always
networks:
- shenyu

shenyu-admin:
image: apache/shenyu-admin:latest
container_name: shenyu-admin
command: [ "-Xmx768m", "-Xms768m" ]
ports:
- "31095:9095"
environment:
- TZ=Asia/Beijing
- SPRING_PROFILES_ACTIVE=mysql
- shenyu.database.dialect=mysql
- shenyu.database.init_enable=true
- spring.datasource.username=shenyue2e
- spring.datasource.password=shenyue2e
- spring.datasource.url=jdbc:mysql://shenyu-mysql:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
- shenyu.sync.etcd.url=http://shenyu-etcd:2379
- shenyu.jwt.secretKey=shenyu-e2e-jwt-secret-key-2024
volumes:
- /tmp/shenyu-e2e/mysql/driver:/opt/shenyu-admin/ext-lib
healthcheck:
test: [ "CMD-SHELL", "wget -q -O - http://shenyu-admin:9095/actuator/health | grep UP || exit 1" ]
interval: 10s
timeout: 5s
retries: 15
start_period: 30s
restart: always
depends_on:
shenyu-mysql:
condition: service_healthy
shenyu-etcd:
condition: service_healthy
networks:
- shenyu

shenyu-bootstrap:
image: apache/shenyu-bootstrap:latest
container_name: shenyu-bootstrap
ports:
- "31195:9195"
environment:
- TZ=Asia/Beijing
- shenyu.sync.etcd.url=http://shenyu-etcd:2379
- spring.cloud.discovery.enabled=true
- eureka.client.enabled=true
- eureka.client.serviceUrl.defaultZone=http://shenyu-examples-eureka:8761/eureka/
- eureka.instance.prefer-ip-address=true
healthcheck:
test: [ "CMD-SHELL", "wget -q -O - http://shenyu-bootstrap:9195/actuator/health | grep UP || exit 1" ]
interval: 10s
timeout: 5s
retries: 15
start_period: 30s
restart: always
depends_on:
shenyu-admin:
condition: service_healthy
networks:
- shenyu

networks:
shenyu:
name: shenyu
driver: bridge
external: true
Loading