From ac0ea89d836f2722e8589fa4725b4e68faa1327b Mon Sep 17 00:00:00 2001
From: yangjj-iso <3202137046@qq.com>
Date: Wed, 14 Oct 2026 19:56:25 +0800
Subject: [PATCH 01/11] docs(apollo): announce staged plugin-store migration
---
README.md | 2 +-
RELEASE-NOTES.md | 8 ++
docs/plugin-store-apollo.md | 210 ++++++++++++++++++++++++++++++++++++
shenyu-registry/README.md | 2 +-
4 files changed, 220 insertions(+), 2 deletions(-)
create mode 100644 docs/plugin-store-apollo.md
diff --git a/README.md b/README.md
index aa217f08d238..44efde0696d4 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ Apache ShenYu is a Java-based gateway for service proxying, protocol conversion,
| Registration and discovery | Client SDKs register service addresses and API metadata with Admin. Registry integrations support discovery; an optional Kubernetes controller reconciles Ingress and Endpoints resources. |
| Security and traffic control | WAF, signing, authentication plugins, load balancing, rate limiting, and fault tolerance through Resilience4j and Sentinel; deprecated Hystrix remains available as an external plugin (see [plugin-store-hystrix](docs/plugin-store-hystrix.md)). |
| Caching and transformation | In-memory or Redis-backed response caching, URL rewriting, redirection, and request/response transformation. |
-| Dynamic configuration | Admin persists plugins, selectors, rules, metadata, and authentication data. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos, etcd, and Apollo are available. Consul sync is available as an external extension (see [plugin-store-consul](docs/plugin-store-consul.md)). Gateway replicas apply updates to their local caches. |
+| Dynamic configuration | Admin persists plugins, selectors, rules, metadata, and authentication data. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos, and etcd are available. Apollo remains available during its deprecation release and is planned to move to an external extension (see [Apollo migration](docs/plugin-store-apollo.md)). Consul sync is available as an external extension (see [plugin-store-consul](docs/plugin-store-consul.md)). Gateway replicas apply updates to their local caches. |
| Observability | Metrics and logging plugins, including Kafka and Elasticsearch destinations; email and DingTalk alerts from Admin. |
| AI and MCP | AI proxy, prompt processing, token limits, sensitive-word filtering, AI request/response transformation, and an MCP server plugin with SSE and Streamable HTTP. |
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 65a7892c9142..fb14b1835e1b 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -2,6 +2,14 @@
### API Changes
+- Apollo's in-tree registry, sync adapter, Admin listener and sync starter are
+ deprecated for transfer to plugin-store (#7599). All four remain available in
+ the release carrying this notice. Removal requires dev-list consensus, a full
+ released deprecation cycle, compatible external artifact publication and an
+ announced rollback window; no removal release is scheduled. See the
+ [migration guide](docs/plugin-store-apollo.md). Existing `apollo` type names,
+ keys and `ApolloPathConstants` remain compatibility contracts.
+
- `MemorySafeLRUMap` is deprecated since 2.7.2. The class, public constructors,
serialization identifier and existing behavior are retained for downstream
source and binary compatibility. No removal release is scheduled; a future
diff --git a/docs/plugin-store-apollo.md b/docs/plugin-store-apollo.md
new file mode 100644
index 000000000000..1c6bd65baeb2
--- /dev/null
+++ b/docs/plugin-store-apollo.md
@@ -0,0 +1,210 @@
+
+# Apollo plugin-store migration
+
+## Status and deprecation cycle
+
+Apollo is currently an optional, supported in-tree integration. Issue [#7599](https://github.com/apache/shenyu/issues/7599)
+proposes transferring its registry, data-sync, Admin listener and gateway starter to
+[plugin-store](https://github.com/apache/shenyu-plugin-store), extending [#7306](https://github.com/apache/shenyu/issues/7306).
+This guide is the advance deprecation notice: the in-tree modules remain available
+for the release carrying this notice. No removal release has been selected.
+The separate removal PR is a draft and must not be merged in that deprecation release.
+
+| Stage | Required action |
+| --- | --- |
+| Agreement | Obtain and link the dev-list decision approving Apollo externalization. |
+| Deprecation release | Ship this notice and migration guide in a core release while retaining all four in-tree modules. Record that released version publicly. |
+| Receiving parity | Build/test all four modules together in plugin-store, verify external SPI loading and unchanged sync/registry configuration. |
+| Publication | Announce compatible core/store versions, publish external artifacts before cutover, and reserve one publisher per Maven group/artifact/version. |
+| Later core release | After the deprecation release has shipped, merge the separate removal, update the release inventory, and announce the rollback window. |
+
+Do not treat creating PRs, merging documentation, or producing local snapshot JARs
+as completing the dev-list decision, a released deprecation cycle, or artifact publication.
+Keep the issue open until all stages and their release evidence are complete.
+
+## Artifact ownership and installation
+
+The receiving `shenyu-extension-apollo` reactor owns these artifacts together:
+
+- `shenyu-admin-listener-apollo`
+- `shenyu-sync-data-apollo`
+- `shenyu-registry-apollo`
+- `shenyu-spring-boot-starter-sync-data-apollo`
+
+The preparation branch uses store `2.7.1-SNAPSHOT` against core `2.7.2-SNAPSHOT`.
+These are development coordinates, not an announced release compatibility matrix.
+For deployment, select the published store release declared compatible with your core release.
+Use the core version for retained APIs and the store version for **all four** Apollo artifacts.
+Keep exactly one provider version on each runtime classpath; the in-tree and external
+implementations retain identical packages and must not coexist.
+
+Admin needs:
+
+```xml
+
+ org.apache.shenyu
+ shenyu-admin-listener-apollo
+ ${store.version}
+
+```
+
+Gateway data synchronization needs:
+
+```xml
+
+ org.apache.shenyu
+ shenyu-spring-boot-starter-sync-data-apollo
+ ${store.version}
+
+```
+
+Applications using Apollo instance registration or SDK instance discovery additionally need:
+
+```xml
+
+ org.apache.shenyu
+ shenyu-registry-apollo
+ ${store.version}
+
+```
+
+Gateway registration also requires the retained core `shenyu-spring-boot-starter-registry`;
+SDK discovery requires the appropriate SDK starter. Apollo was never included in the
+compatibility registry starter, so it remains an explicit provider dependency.
+For binary distributions, resolve the complete runtime dependency closure into `lib/`,
+replace old Apollo JARs, and retain the extension's licensing information and dependency notices.
+
+Shading continues to package Apollo client dependencies, but excludes retained ShenYu
+API artifacts and sibling extension modules. API classes come from the application's core artifacts, preserving
+class identity for external SPI loading. The published POM retains runtime dependencies.
+
+## Enable Admin and gateway synchronization
+
+Admin keeps its existing property prefix and portal publishing settings:
+
+```yaml
+shenyu:
+ sync:
+ websocket:
+ enabled: false
+ apollo:
+ appId: shenyu
+ meta: http://apollo-config-service:8080
+ portalUrl: http://apollo-portal:8070
+ env: DEV
+ clusterName: default
+ namespace: application
+ token: ${APOLLO_OPENAPI_TOKEN}
+ operatorUser: apollo
+```
+
+Gateway keeps the same reading settings; remove or disable the previous sync channel:
+
+```yaml
+shenyu:
+ namespace: 649330b6-c2d7-4edc-be8e-8a54df9eb385
+ sync:
+ websocket:
+ urls: false
+ apollo:
+ appId: shenyu
+ meta: http://apollo-config-service:8080
+ env: DEV
+ clusterName: default
+ namespace: application
+ accessKey: ${APOLLO_ACCESS_KEY:}
+```
+
+The portal OpenAPI token and config-service access key serve different APIs.
+Ensure the publishing app, environment, cluster and Apollo namespace match the reader.
+The preserved reader calls Apollo `ConfigService.getAppConfig()`, so the example uses
+`application`. This migration does not add arbitrary namespace selection.
+The ShenYu namespace ID is a separate tenant prefix inside Apollo item keys.
+The Apollo client sets JVM-wide app/meta/cluster properties; preserve the existing
+process-level configuration when using sync and registry together.
+
+## Registry and SPI contract
+
+The external JAR continues to publish:
+
+```text
+META-INF/shenyu/org.apache.shenyu.registry.api.ShenyuInstanceRegisterRepository
+apollo=org.apache.shenyu.registry.apollo.ApolloInstanceRegisterRepository
+```
+
+`ShenyuInstanceRegisterRepositoryFactory.loadRepository("apollo")` resolves that
+resource without any factory or core runtime change, and preserves the non-singleton provider.
+Registry configuration remains:
+
+```yaml
+shenyu:
+ register:
+ enabled: true
+ registerType: apollo
+ serverLists: http://apollo-config-service:8080
+ props:
+ appId: shenyu
+ portalUrl: http://apollo-portal:8070
+ token: ${APOLLO_OPENAPI_TOKEN}
+ env: DEV
+ clusterName: default
+ namespace: application
+```
+
+SDK discovery uses the same `apollo` type and registry settings via its existing SDK
+configuration; it does not replace backend HTTP annotation/API registration.
+Instance registration writes persistent portal items and publishes the namespace.
+Existing shutdown removes listeners; it does not deregister persistent instance items.
+Preserve that behavior during migration and apply your existing instance-removal procedure.
+
+## Stored keys and shared compatibility shim
+
+| Data | Existing Apollo item key |
+| --- | --- |
+| Plugin | `.plugin.` |
+| Selector | `.selector..` |
+| Rule | `.rule...` |
+| Authentication | `.auth.` |
+| Metadata | `.meta.` |
+| Proxy selector | `.proxy.selector..` |
+| Discovery upstream | `.discovery..` |
+| Instance | `/shenyu/register/instance//:` |
+
+The existing `.list` index items under each category/group are retained alongside the data keys.
+JSON DTOs, key prefixes, namespace IDs and the `apollo` type remain unchanged.
+`org.apache.shenyu.common.constant.ApolloPathConstants` stays in core as a small
+constants/path compatibility shim with no Apollo SDK dependency. Do not duplicate that
+class in store JARs or migrate/delete existing keyspaces as part of this transfer.
+
+The client versions remain `apollo-client`, `apollo-openapi` and `apollo-core` `2.1.0`.
+Source and the Apollo clients are Apache-2.0; preserve licenses when assembling custom packages.
+Existing unit tests, real Apollo `DefaultConfig` listener filtering tests and starter
+configuration tests move with their modules. Those tests do not claim a full live Apollo
+portal/config-service deployment; validate your staging deployment before production cutover.
+
+## Upgrade and rollback
+
+1. After publication and release gates pass, back up the Admin database and Apollo
+ application/namespace configuration, recording exact core/store versions and deployed JARs.
+2. Verify the external artifacts in staging using unchanged namespace, endpoints, tokens,
+ keys and registry properties. Check initial sync, create/update/delete and instance updates.
+3. Roll Admin and gateways with complete external dependency closures, then confirm
+ subsequent changes propagate and existing instance discovery still works.
+4. Retain the last in-tree release for the announced rollback window. To roll back,
+ restore its images/JARs and configuration and remove the external Apollo versions.
+ Reuse the same Admin database and Apollo keyspace; do not clear either during rollback.
diff --git a/shenyu-registry/README.md b/shenyu-registry/README.md
index d91f0f8ef0e5..66ea84e1b5c2 100644
--- a/shenyu-registry/README.md
+++ b/shenyu-registry/README.md
@@ -40,7 +40,7 @@ runtime classpath, using the same ShenYu version as the application:
| `zookeeper` | `shenyu-registry-zookeeper` |
| `etcd` | `shenyu-registry-etcd` |
| `nacos` | `shenyu-registry-nacos` |
-| `apollo` | `shenyu-registry-apollo` |
+| `apollo` | `shenyu-registry-apollo`; in-tree deprecation and planned external ownership: [migration guide](../docs/plugin-store-apollo.md) |
| `eureka` | `shenyu-registry-eureka` |
| `kubernetes` | `shenyu-registry-kubernetes` |
From 06125d3fa7922dd18718ce2003e75c102e837aeb Mon Sep 17 00:00:00 2001
From: yangjj-iso <3202137046@qq.com>
Date: Wed, 14 Oct 2026 20:04:16 +0800
Subject: [PATCH 02/11] refactor(apollo): prepare the later plugin-store
cutover
---
.../scripts/check-registry-dependencies.py | 4 +-
README.md | 2 +-
RELEASE-NOTES.md | 18 +-
docs/plugin-store-apollo.md | 7 +-
pom.xml | 13 -
shenyu-admin-listener/pom.xml | 1 -
.../shenyu-admin-listener-apollo/pom.xml | 73 ----
.../admin/config/ApolloSyncConfiguration.java | 76 ----
.../config/properties/ApolloProperties.java | 196 ---------
.../admin/listener/apollo/ApolloClient.java | 149 -------
.../apollo/ApolloDataChangedInit.java | 65 ---
.../apollo/ApolloDataChangedListener.java | 63 ---
.../main/resources/META-INF/spring.factories | 19 -
.../main/resources/META-INF/spring.provides | 18 -
...ot.autoconfigure.AutoConfiguration.imports | 18 -
.../listener/apollo/ApolloClientTest.java | 94 -----
.../apollo/ApolloDataChangedInitTest.java | 103 -----
.../apollo/ApolloDataChangedListenerTest.java | 93 -----
.../src/main/resources/application.yml | 8 -
.../src/main/resources/application.yml | 6 -
.../src/main/release-docs/LICENSE | 3 -
.../src/main/release-docs/LICENSE | 3 -
.../src/main/resources/application.yml | 6 -
.../src/main/resources/application.yml | 6 -
.../src/main/resources/application.yml | 6 -
shenyu-registry/README.md | 8 +-
shenyu-registry/pom.xml | 1 -
.../shenyu-registry-apollo/pom.xml | 71 ----
.../shenyu/registry/apollo/ApolloClient.java | 134 ------
.../shenyu/registry/apollo/ApolloConfig.java | 150 -------
.../ApolloInstanceRegisterRepository.java | 186 ---------
...istry.api.ShenyuInstanceRegisterRepository | 17 -
.../registry/apollo/ApolloClientTest.java | 98 -----
.../registry/apollo/ApolloConfigTest.java | 61 ---
.../ApolloInstanceRegisterRepositoryTest.java | 109 -----
.../registry/apollo/RegistrySpiTest.java | 33 --
.../pom.xml | 1 -
.../pom.xml | 56 ---
.../apollo/ApolloSyncDataConfiguration.java | 116 ------
...ot.autoconfigure.AutoConfiguration.imports | 18 -
.../ApolloSyncDataConfigurationTest.java | 87 ----
shenyu-sync-data-center/pom.xml | 1 -
.../shenyu-sync-data-apollo/pom.xml | 40 --
.../sync/data/apollo/ApolloDataService.java | 175 --------
.../sync/data/apollo/config/ApolloConfig.java | 155 -------
.../ApolloDataServiceIntegrationTest.java | 141 -------
.../data/apollo/ApolloDataServiceTest.java | 391 ------------------
.../data/apollo/config/ApolloConfigTest.java | 62 ---
48 files changed, 22 insertions(+), 3139 deletions(-)
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/pom.xml
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/ApolloSyncConfiguration.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/properties/ApolloProperties.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloClient.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedInit.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedListener.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.factories
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.provides
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/test/java/org/apache/shenyu/admin/listener/apollo/ApolloClientTest.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/test/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedInitTest.java
delete mode 100644 shenyu-admin-listener/shenyu-admin-listener-apollo/src/test/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedListenerTest.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/pom.xml
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloClient.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloConfig.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepository.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/main/resources/META-INF/shenyu/org.apache.shenyu.registry.api.ShenyuInstanceRegisterRepository
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/test/java/org/apache/shenyu/registry/apollo/ApolloClientTest.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/test/java/org/apache/shenyu/registry/apollo/ApolloConfigTest.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/test/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepositoryTest.java
delete mode 100644 shenyu-registry/shenyu-registry-apollo/src/test/java/org/apache/shenyu/registry/apollo/RegistrySpiTest.java
delete mode 100644 shenyu-spring-boot-starter/shenyu-spring-boot-starter-sync-data-center/shenyu-spring-boot-starter-sync-data-apollo/pom.xml
delete mode 100644 shenyu-spring-boot-starter/shenyu-spring-boot-starter-sync-data-center/shenyu-spring-boot-starter-sync-data-apollo/src/main/java/org/apache/shenyu/springboot/sync/data/apollo/ApolloSyncDataConfiguration.java
delete mode 100644 shenyu-spring-boot-starter/shenyu-spring-boot-starter-sync-data-center/shenyu-spring-boot-starter-sync-data-apollo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
delete mode 100644 shenyu-spring-boot-starter/shenyu-spring-boot-starter-sync-data-center/shenyu-spring-boot-starter-sync-data-apollo/src/test/java/org/apache/shenyu/springboot/sync/data/apollo/ApolloSyncDataConfigurationTest.java
delete mode 100644 shenyu-sync-data-center/shenyu-sync-data-apollo/pom.xml
delete mode 100644 shenyu-sync-data-center/shenyu-sync-data-apollo/src/main/java/org/apache/shenyu/sync/data/apollo/ApolloDataService.java
delete mode 100644 shenyu-sync-data-center/shenyu-sync-data-apollo/src/main/java/org/apache/shenyu/sync/data/apollo/config/ApolloConfig.java
delete mode 100644 shenyu-sync-data-center/shenyu-sync-data-apollo/src/test/java/org/apache/shenyu/sync/data/apollo/ApolloDataServiceIntegrationTest.java
delete mode 100644 shenyu-sync-data-center/shenyu-sync-data-apollo/src/test/java/org/apache/shenyu/sync/data/apollo/ApolloDataServiceTest.java
delete mode 100644 shenyu-sync-data-center/shenyu-sync-data-apollo/src/test/java/org/apache/shenyu/sync/data/apollo/config/ApolloConfigTest.java
diff --git a/.github/scripts/check-registry-dependencies.py b/.github/scripts/check-registry-dependencies.py
index ff233ff0c332..f968282c8c56 100644
--- a/.github/scripts/check-registry-dependencies.py
+++ b/.github/scripts/check-registry-dependencies.py
@@ -18,8 +18,8 @@
import sys
from pathlib import Path
-PROVIDERS = ("zookeeper", "etcd", "nacos", "apollo", "eureka", "kubernetes")
-COMPATIBILITY_PROVIDERS = set(PROVIDERS) - {"apollo"}
+PROVIDERS = ("zookeeper", "etcd", "nacos", "eureka", "kubernetes")
+COMPATIBILITY_PROVIDERS = set(PROVIDERS)
LEAN_MODULES = (
"shenyu-registry/shenyu-registry-api",
"shenyu-registry/shenyu-registry-core",
diff --git a/README.md b/README.md
index 44efde0696d4..862c72322792 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ Apache ShenYu is a Java-based gateway for service proxying, protocol conversion,
| Registration and discovery | Client SDKs register service addresses and API metadata with Admin. Registry integrations support discovery; an optional Kubernetes controller reconciles Ingress and Endpoints resources. |
| Security and traffic control | WAF, signing, authentication plugins, load balancing, rate limiting, and fault tolerance through Resilience4j and Sentinel; deprecated Hystrix remains available as an external plugin (see [plugin-store-hystrix](docs/plugin-store-hystrix.md)). |
| Caching and transformation | In-memory or Redis-backed response caching, URL rewriting, redirection, and request/response transformation. |
-| Dynamic configuration | Admin persists plugins, selectors, rules, metadata, and authentication data. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos, and etcd are available. Apollo remains available during its deprecation release and is planned to move to an external extension (see [Apollo migration](docs/plugin-store-apollo.md)). Consul sync is available as an external extension (see [plugin-store-consul](docs/plugin-store-consul.md)). Gateway replicas apply updates to their local caches. |
+| Dynamic configuration | Admin persists plugins, selectors, rules, metadata, and authentication data. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos, and etcd are available. Apollo sync and registry are available as an external extension (see [Apollo migration](docs/plugin-store-apollo.md)). Consul sync is available as an external extension (see [plugin-store-consul](docs/plugin-store-consul.md)). Gateway replicas apply updates to their local caches. |
| Observability | Metrics and logging plugins, including Kafka and Elasticsearch destinations; email and DingTalk alerts from Admin. |
| AI and MCP | AI proxy, prompt processing, token limits, sensitive-word filtering, AI request/response transformation, and an MCP server plugin with SSE and Streamable HTTP. |
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index fb14b1835e1b..02963c1f6046 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -2,13 +2,11 @@
### API Changes
-- Apollo's in-tree registry, sync adapter, Admin listener and sync starter are
- deprecated for transfer to plugin-store (#7599). All four remain available in
- the release carrying this notice. Removal requires dev-list consensus, a full
- released deprecation cycle, compatible external artifact publication and an
- announced rollback window; no removal release is scheduled. See the
- [migration guide](docs/plugin-store-apollo.md). Existing `apollo` type names,
- keys and `ApolloPathConstants` remain compatibility contracts.
+- The external Apollo stack retains the `apollo` SPI/configuration type and
+ existing stored keys (#7599). `ApolloPathConstants` remains in core as a small
+ compatibility shim without an Apollo SDK dependency. The separate deprecation
+ notice must have shipped in a preceding core release before this cutover can
+ merge; see the [migration guide](docs/plugin-store-apollo.md).
- `MemorySafeLRUMap` is deprecated since 2.7.2. The class, public constructors,
serialization identifier and existing behavior are retained for downstream
@@ -28,6 +26,12 @@
### Behavior Changes
+- Apollo's runtime modules and sync starter are transferred to plugin-store in
+ this later cutover change (#7599). Merge and release only after the separate
+ deprecation notice has shipped in a preceding core release, dev-list agreement,
+ passing receiving CI and external publication. Existing configurations and
+ `ApolloPathConstants` remain compatible; see the [migration guide](docs/plugin-store-apollo.md).
+
- HTTP client registration now treats non-success Admin responses as failures,
using the same bounded failback policy as transport errors (18 retry attempts
per pending task). The text response contract does not reliably distinguish
diff --git a/docs/plugin-store-apollo.md b/docs/plugin-store-apollo.md
index 1c6bd65baeb2..e65bc39412be 100644
--- a/docs/plugin-store-apollo.md
+++ b/docs/plugin-store-apollo.md
@@ -18,11 +18,12 @@ limitations under the License.
## Status and deprecation cycle
-Apollo is currently an optional, supported in-tree integration. Issue [#7599](https://github.com/apache/shenyu/issues/7599)
+This source branch prepares the later removal of Apollo from the core reactor.
+The published deprecation release must retain its in-tree integration. Issue [#7599](https://github.com/apache/shenyu/issues/7599)
proposes transferring its registry, data-sync, Admin listener and gateway starter to
[plugin-store](https://github.com/apache/shenyu-plugin-store), extending [#7306](https://github.com/apache/shenyu/issues/7306).
-This guide is the advance deprecation notice: the in-tree modules remain available
-for the release carrying this notice. No removal release has been selected.
+The separate deprecation PR publishes the advance notice and this guide while
+retaining all four modules for that release. No removal release has been selected.
The separate removal PR is a draft and must not be merged in that deprecation release.
| Stage | Required action |
diff --git a/pom.xml b/pom.xml
index 41146d6af896..13001f82f70a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -169,7 +169,6 @@
2.9.34.1.59.2
- 2.1.01.7.11.8.36.1.2.RELEASE
@@ -373,18 +372,6 @@
${zookeeper.version}
-
- com.ctrip.framework.apollo
- apollo-client
- ${apollo.version}
-
-
-
- com.ctrip.framework.apollo
- apollo-openapi
- ${apollo.version}
-
-
com.github.pagehelperpagehelper
diff --git a/shenyu-admin-listener/pom.xml b/shenyu-admin-listener/pom.xml
index 7ee0cc7eb311..3e4950a58e01 100644
--- a/shenyu-admin-listener/pom.xml
+++ b/shenyu-admin-listener/pom.xml
@@ -29,7 +29,6 @@
shenyu-admin-listener-api
- shenyu-admin-listener-apolloshenyu-admin-listener-etcdshenyu-admin-listener-nacosshenyu-admin-listener-zookeeper
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/pom.xml b/shenyu-admin-listener/shenyu-admin-listener-apollo/pom.xml
deleted file mode 100644
index ec32304930e1..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
- 4.0.0
-
- org.apache.shenyu
- shenyu-admin-listener
- 2.7.2-SNAPSHOT
-
-
- shenyu-admin-listener-apollo
-
-
-
- com.ctrip.framework.apollo
- apollo-openapi
-
-
-
- org.apache.shenyu
- shenyu-admin-listener-api
- ${project.version}
-
-
-
- org.springframework.boot
- spring-boot-starter-web
- provided
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- ${maven-shade-plugin.version}
-
-
-
-
- package
-
- shade
-
-
-
-
-
-
-
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/ApolloSyncConfiguration.java b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/ApolloSyncConfiguration.java
deleted file mode 100644
index 755c79439499..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/ApolloSyncConfiguration.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.admin.config;
-
-import org.apache.shenyu.admin.config.properties.ApolloProperties;
-import org.apache.shenyu.admin.listener.DataChangedInit;
-import org.apache.shenyu.admin.listener.DataChangedListener;
-import org.apache.shenyu.admin.listener.apollo.ApolloClient;
-import org.apache.shenyu.admin.listener.apollo.ApolloDataChangedInit;
-import org.apache.shenyu.admin.listener.apollo.ApolloDataChangedListener;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * the type apollo listener.
- */
-@Configuration
-@ConditionalOnProperty(prefix = "shenyu.sync.apollo", name = "meta")
-@EnableConfigurationProperties(ApolloProperties.class)
-public class ApolloSyncConfiguration {
-
-
- /**
- * init Consul client.
- *
- * @param apolloProperties the apollo properties
- * @return apollo client
- */
- @Bean
- public ApolloClient apolloClient(final ApolloProperties apolloProperties) {
- return new ApolloClient(apolloProperties);
- }
-
- /**
- * Config event listener data changed listener.
- *
- * @param apolloClient the apollo client
- * @return the data changed listener
- */
- @Bean
- @ConditionalOnMissingBean(ApolloDataChangedListener.class)
- public DataChangedListener apolloDataChangeListener(final ApolloClient apolloClient) {
- return new ApolloDataChangedListener(apolloClient);
- }
-
- /**
- * apollo data init.
- *
- * @param apolloClient the apollo client
- * @return the apollo data init
- */
- @Bean
- @ConditionalOnMissingBean(ApolloDataChangedInit.class)
- public DataChangedInit apolloDataChangeInit(final ApolloClient apolloClient) {
- return new ApolloDataChangedInit(apolloClient);
- }
-
-}
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/properties/ApolloProperties.java b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/properties/ApolloProperties.java
deleted file mode 100644
index b1a100ff44f0..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/config/properties/ApolloProperties.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * 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.admin.config.properties;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@ConfigurationProperties("shenyu.sync.apollo")
-public class ApolloProperties {
-
- /**
- * appId.
- */
- private String appId;
-
- /**
- * apollo config service url.
- */
- private String meta;
-
- /**
- * portal url.
- * e.g. localhost:8080
- */
- private String portalUrl;
-
- /**
- * env.
- * e.g. ENV
- */
- private String env;
-
- /**
- * cluster name.
- */
- private String clusterName;
-
- /**
- * namespace name.
- */
- private String namespace;
-
- /**
- * open api use token.
- */
- private String token;
-
- /**
- * operatorUser.
- */
- private String operatorUser;
-
- /**
- * get appId.
- * @return appId
- */
- public String getAppId() {
- return appId;
- }
-
- /**
- * set app id.
- * @param appId app id
- */
- public void setAppId(final String appId) {
- this.appId = appId;
- }
-
- /**
- * get config service url.
- * @return config service url
- */
- public String getMeta() {
- return meta;
- }
-
- /**
- * set config service url.
- * @param meta config service url
- */
- public void setMeta(final String meta) {
- this.meta = meta;
- }
-
- /**
- * get portal url.
- * @return portal url
- */
- public String getPortalUrl() {
- return portalUrl;
- }
-
- /**
- * set portal url.
- * @param portalUrl portal url
- */
- public void setPortalUrl(final String portalUrl) {
- this.portalUrl = portalUrl;
- }
-
- /**
- * get env.
- * @return env
- */
- public String getEnv() {
- return env;
- }
-
- /**
- * set env.
- * @param env env
- */
- public void setEnv(final String env) {
- this.env = env;
- }
-
- /**
- * get cluster name.
- * @return cluster name
- */
- public String getClusterName() {
- return clusterName;
- }
-
- /**
- * set cluster name.
- * @param clusterName cluster name
- */
- public void setClusterName(final String clusterName) {
- this.clusterName = clusterName;
- }
-
- /**
- * get namespace name.
- * @return namespace name
- */
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * set namespace name.
- * @param namespace namespace name
- */
- public void setNamespace(final String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * get token.
- * @return token
- */
- public String getToken() {
- return token;
- }
-
- /**
- * set token.
- * @param token token
- */
- public void setToken(final String token) {
- this.token = token;
- }
-
- /**
- * operatorUser.
- *
- * @return OperatorUser
- */
- public String getOperatorUser() {
- return operatorUser;
- }
-
- /**
- * set operatorUser.
- *
- * @param operatorUser operatorUser
- */
- public void setOperatorUser(final String operatorUser) {
- this.operatorUser = operatorUser;
- }
-}
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloClient.java b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloClient.java
deleted file mode 100644
index 580b942ed0fc..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloClient.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * 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.admin.listener.apollo;
-
-import com.ctrip.framework.apollo.openapi.client.ApolloOpenApiClient;
-import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO;
-import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO;
-import org.apache.shenyu.admin.config.properties.ApolloProperties;
-import org.apache.shenyu.common.exception.ShenyuException;
-import org.apache.shenyu.common.utils.GsonUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Date;
-import java.util.Objects;
-import java.util.Optional;
-
-/**
- * apollo open-api client.
- */
-public class ApolloClient {
-
- private static final Logger LOG = LoggerFactory.getLogger(ApolloClient.class);
-
- private final String operatorUser;
-
- private final ApolloProperties apolloConfig;
-
- private final ApolloOpenApiClient apolloOpenApiClient;
-
- public ApolloClient(final ApolloProperties apolloConfig) {
- this.apolloConfig = apolloConfig;
-
- this.apolloOpenApiClient = ApolloOpenApiClient
- .newBuilder()
- .withPortalUrl(apolloConfig.getPortalUrl())
- .withToken(apolloConfig.getToken())
- .build();
- operatorUser = Optional.ofNullable(apolloConfig.getOperatorUser()).orElse("apollo");
- }
-
- /**
- * get item value.
- * @param key item key
- * @return item value
- */
- public String getItemValue(final String key) {
- OpenItemDTO openItemDTO = this.apolloOpenApiClient.getItem(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- key);
- if (Objects.isNull(openItemDTO)) {
- return null;
- }
- if (openItemDTO.getKey().equals("timeout")) {
- LOG.error("apollo client getItemValue time out");
- throw new ShenyuException("apollo client getItemValue time out");
- }
- return openItemDTO.getValue();
- }
-
-
- /**
- * removeItemKey.
- *
- * @param key key
- */
- public void removeItemKey(final String key) {
- this.apolloOpenApiClient.removeItem(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- key, operatorUser);
- }
-
- /**
- * create or update item into namespace.
- * @param key item key
- * @param value item value
- * @param comment item comment
- */
- public void createOrUpdateItem(final String key, final Object value, final String comment) {
- this.createOrUpdateItem(key, GsonUtils.getInstance().toJson(value), comment);
- }
-
- /**
- * create or update item into namespace.
- * @param key item key
- * @param value item value
- * @param comment item comment
- */
- public void createOrUpdateItem(final String key, final String value, final String comment) {
- OpenItemDTO openItemDTO = new OpenItemDTO();
- openItemDTO.setKey(key);
- openItemDTO.setValue(value);
- openItemDTO.setComment(comment);
- openItemDTO.setDataChangeCreatedBy(operatorUser);
- openItemDTO.setDataChangeLastModifiedBy(operatorUser);
- Date now = new Date();
- openItemDTO.setDataChangeCreatedTime(now);
- openItemDTO.setDataChangeLastModifiedTime(now);
-
- this.apolloOpenApiClient.createOrUpdateItem(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- openItemDTO
- );
- }
-
- /**
- * publish item list in namespace.
- * @param releaseTitle publish release title
- * @param releaseComment publish release comment
- */
- public void publishNamespace(final String releaseTitle, final String releaseComment) {
- NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO();
- namespaceReleaseDTO.setReleaseTitle(releaseTitle);
- namespaceReleaseDTO.setReleaseComment(releaseComment);
- namespaceReleaseDTO.setReleasedBy(operatorUser);
-
- this.apolloOpenApiClient.publishNamespace(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- namespaceReleaseDTO
- );
- }
-}
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedInit.java b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedInit.java
deleted file mode 100644
index ee1090b03cf9..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedInit.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.admin.listener.apollo;
-
-import org.apache.shenyu.admin.listener.AbstractDataChangedInit;
-import org.apache.shenyu.admin.listener.utils.NodeDataPathUtils;
-import org.apache.shenyu.common.constant.ApolloPathConstants;
-
-import java.util.Objects;
-import java.util.stream.Stream;
-
-/**
- * the type apollo data change init.
- *
- * @since 2.6.0
- */
-public class ApolloDataChangedInit extends AbstractDataChangedInit {
- private final ApolloClient apolloClient;
-
- /**
- * Instantiates a new apollo data changed init.
- *
- * @param apolloClient the apollo client
- */
- public ApolloDataChangedInit(final ApolloClient apolloClient) {
- this.apolloClient = apolloClient;
- }
-
- /**
- * not exist.
- *
- * @return true if not exist
- */
- @Override
- protected boolean notExist() {
- return Stream.of(ApolloPathConstants.PLUGIN_DATA_ID, ApolloPathConstants.AUTH_DATA_ID, ApolloPathConstants.META_DATA_ID, ApolloPathConstants.PROXY_SELECTOR_DATA_ID)
- .map(NodeDataPathUtils::appendListStuff)
- .allMatch(this::dataIdNotExist);
- }
-
- /**
- * Data id not exist boolean.
- *
- * @param pluginDataId the plugin data id
- * @return the boolean
- */
- private boolean dataIdNotExist(final String pluginDataId) {
- return Objects.isNull(apolloClient.getItemValue(pluginDataId));
- }
-}
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedListener.java b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedListener.java
deleted file mode 100644
index eab59e12e28f..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/java/org/apache/shenyu/admin/listener/apollo/ApolloDataChangedListener.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.admin.listener.apollo;
-
-import org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener;
-import org.apache.shenyu.common.constant.ApolloPathConstants;
-
-/**
- * use apollo to push data changes.
- *
- * @since 2.6.0
- */
-public class ApolloDataChangedListener extends AbstractNodeDataChangedListener {
- private final ApolloClient apolloClient;
-
- /**
- * Instantiates a new apollo data changed listener.
- *
- * @param apolloClient the apollo client
- */
- public ApolloDataChangedListener(final ApolloClient apolloClient) {
- super(new ChangeData(ApolloPathConstants.PLUGIN_DATA_ID,
- ApolloPathConstants.SELECTOR_DATA_ID,
- ApolloPathConstants.RULE_DATA_ID,
- ApolloPathConstants.AUTH_DATA_ID,
- ApolloPathConstants.META_DATA_ID,
- ApolloPathConstants.PROXY_SELECTOR_DATA_ID,
- ApolloPathConstants.DISCOVERY_DATA_ID));
- this.apolloClient = apolloClient;
- }
-
- @Override
- public void doPublishConfig(final String dataId, final Object data) {
- this.apolloClient.createOrUpdateItem(dataId, data, "create config data");
- this.apolloClient.publishNamespace("publish config data", "");
- }
-
- @Override
- public String getConfig(final String dataId) {
- return this.apolloClient.getItemValue(dataId);
- }
-
- @Override
- public void doDelConfig(final String dataId) {
- this.apolloClient.removeItemKey(dataId);
- this.apolloClient.publishNamespace("delete config data", "");
- }
-}
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.factories b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index f210012816e8..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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.
-#
-
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-org.apache.shenyu.admin.config.ApolloSyncConfiguration
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.provides b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.provides
deleted file mode 100644
index 9893ff1dba24..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring.provides
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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.
-#
-
-provides: shenyu-admin-listener-apollo
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
deleted file mode 100644
index cda1dd637890..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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.
-#
-
-org.apache.shenyu.admin.config.ApolloSyncConfiguration
diff --git a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/test/java/org/apache/shenyu/admin/listener/apollo/ApolloClientTest.java b/shenyu-admin-listener/shenyu-admin-listener-apollo/src/test/java/org/apache/shenyu/admin/listener/apollo/ApolloClientTest.java
deleted file mode 100644
index 10385d90fe64..000000000000
--- a/shenyu-admin-listener/shenyu-admin-listener-apollo/src/test/java/org/apache/shenyu/admin/listener/apollo/ApolloClientTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.admin.listener.apollo;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import org.apache.shenyu.admin.config.properties.ApolloProperties;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@ContextConfiguration(classes = {ApolloProperties.class})
-@RunWith(SpringJUnit4ClassRunner.class)
-public class ApolloClientTest {
-
- @MockBean
- private ApolloClient apolloClient;
-
- /**
- * Method under test: {@link ApolloClient#ApolloClient(ApolloProperties)}.
- */
- @Test
- public void testConstructor() {
- ApolloProperties apolloConfig = new ApolloProperties();
- apolloConfig.setAppId("42");
- apolloConfig.setClusterName("Cluster Name");
- apolloConfig.setEnv("Env");
- apolloConfig.setMeta("Meta");
- apolloConfig.setNamespace("Namespace");
- apolloConfig.setPortalUrl("http://localhost:8080");
- apolloConfig.setToken("ABC123");
- new ApolloClient(apolloConfig);
- assertEquals("42", apolloConfig.getAppId());
- assertEquals("ABC123", apolloConfig.getToken());
- assertEquals("http://localhost:8080", apolloConfig.getPortalUrl());
- assertEquals("Namespace", apolloConfig.getNamespace());
- assertEquals("Meta", apolloConfig.getMeta());
- assertEquals("Env", apolloConfig.getEnv());
- assertEquals("Cluster Name", apolloConfig.getClusterName());
- }
-
- /**
- * Method under test: {@link ApolloClient#getItemValue(String)}.
- */
- @Test
- public void testGetItemValue() {
- when(apolloClient.getItemValue(Mockito.any())).thenReturn("42");
- assertEquals("42", apolloClient.getItemValue("Key"));
- verify(apolloClient).getItemValue(Mockito.any());
- }
-
- /**
- * Method under test: {@link ApolloClient#createOrUpdateItem(String, Object, String)}.
- */
- @Test
- public void testCreateOrUpdateItem() {
- doNothing().when(apolloClient)
- .createOrUpdateItem(Mockito.any(), Mockito.
diff --git a/shenyu-registry/shenyu-registry-apollo/pom.xml b/shenyu-registry/shenyu-registry-apollo/pom.xml
deleted file mode 100644
index 9a118eae1899..000000000000
--- a/shenyu-registry/shenyu-registry-apollo/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
- org.apache.shenyu
- shenyu-registry
- 2.7.2-SNAPSHOT
-
- 4.0.0
- shenyu-registry-apollo
-
-
-
- org.apache.shenyu
- shenyu-registry-api
- ${project.version}
-
-
-
- com.ctrip.framework.apollo
- apollo-client
-
-
-
- com.ctrip.framework.apollo
- apollo-openapi
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- ${maven-shade-plugin.version}
-
-
-
-
- package
-
- shade
-
-
-
-
-
-
-
diff --git a/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloClient.java b/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloClient.java
deleted file mode 100644
index 23b6915fb890..000000000000
--- a/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloClient.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.registry.apollo;
-
-import com.ctrip.framework.apollo.openapi.client.ApolloOpenApiClient;
-import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO;
-import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO;
-import org.apache.shenyu.common.utils.GsonUtils;
-
-import java.util.Date;
-
-/**
- * apollo open-api client.
- */
-public class ApolloClient {
-
- private static final String DEFAULT_USER = "apollo";
-
- private final ApolloConfig apolloConfig;
-
- private final ApolloOpenApiClient apolloOpenApiClient;
-
- public ApolloClient(final ApolloConfig apolloConfig) {
- this.apolloConfig = apolloConfig;
-
- this.apolloOpenApiClient = ApolloOpenApiClient
- .newBuilder()
- .withPortalUrl(apolloConfig.getPortalUrl())
- .withToken(apolloConfig.getToken())
- .build();
- }
-
- /**
- * get item value.
- * @param key item key
- * @return item value
- */
- public String getItemValue(final String key) {
- OpenItemDTO openItemDTO = this.apolloOpenApiClient.getItem(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- key
- );
- return openItemDTO.getValue();
- }
-
- /**
- * create or update item into namespace.
- * @param key item key
- * @param value item value
- * @param comment item comment
- */
- public void createOrUpdateItem(final String key, final Object value, final String comment) {
- this.createOrUpdateItem(key, GsonUtils.getInstance().toJson(value), comment);
- }
-
- /**
- * create or update item into namespace.
- * @param key item key
- * @param value item value
- * @param comment item comment
- */
- public void createOrUpdateItem(final String key, final String value, final String comment) {
- OpenItemDTO openItemDTO = new OpenItemDTO();
- openItemDTO.setKey(key);
- openItemDTO.setValue(value);
- openItemDTO.setComment(comment);
- openItemDTO.setDataChangeCreatedBy(DEFAULT_USER);
- openItemDTO.setDataChangeLastModifiedBy(DEFAULT_USER);
- Date now = new Date();
- openItemDTO.setDataChangeCreatedTime(now);
- openItemDTO.setDataChangeLastModifiedTime(now);
-
- this.apolloOpenApiClient.createOrUpdateItem(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- openItemDTO
- );
- }
-
- /**
- * remove item from namespace.
- * @param key item key
- */
- public void removeItem(final String key) {
- this.apolloOpenApiClient.removeItem(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- key,
- DEFAULT_USER
- );
- }
-
- /**
- * publish item list in namespace.
- * @param releaseTitle publish release title
- * @param releaseComment publish release comment
- */
- public void publishNamespace(final String releaseTitle, final String releaseComment) {
- NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO();
- namespaceReleaseDTO.setReleaseTitle(releaseTitle);
- namespaceReleaseDTO.setReleaseComment(releaseComment);
- namespaceReleaseDTO.setReleasedBy(DEFAULT_USER);
-
- this.apolloOpenApiClient.publishNamespace(
- apolloConfig.getAppId(),
- apolloConfig.getEnv(),
- apolloConfig.getClusterName(),
- apolloConfig.getNamespace(),
- namespaceReleaseDTO
- );
- }
-}
diff --git a/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloConfig.java b/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloConfig.java
deleted file mode 100644
index 6eb3c10cd1f1..000000000000
--- a/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloConfig.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.registry.apollo;
-
-public class ApolloConfig {
-
- /**
- * appId.
- */
- private String appId;
-
- /**
- * portal url.
- * e.g. localhost:8080
- */
- private String portalUrl;
-
- /**
- * env.
- * e.g. ENV
- */
- private String env;
-
- /**
- * cluster name.
- */
- private String clusterName;
-
- /**
- * namespace name.
- */
- private String namespace;
-
- /**
- * open api use token.
- */
- private String token;
-
- /**
- * get appId.
- * @return appId
- */
- public String getAppId() {
- return appId;
- }
-
- /**
- * set app id.
- * @param appId app id
- */
- public void setAppId(final String appId) {
- this.appId = appId;
- }
-
- /**
- * get portal url.
- * @return portal url
- */
- public String getPortalUrl() {
- return portalUrl;
- }
-
- /**
- * set portal url.
- * @param portalUrl portal url
- */
- public void setPortalUrl(final String portalUrl) {
- this.portalUrl = portalUrl;
- }
-
- /**
- * get env.
- * @return env
- */
- public String getEnv() {
- return env;
- }
-
- /**
- * set env.
- * @param env env
- */
- public void setEnv(final String env) {
- this.env = env;
- }
-
- /**
- * get cluster name.
- * @return cluster name
- */
- public String getClusterName() {
- return clusterName;
- }
-
- /**
- * set cluster name.
- * @param clusterName cluster name
- */
- public void setClusterName(final String clusterName) {
- this.clusterName = clusterName;
- }
-
- /**
- * get namespace name.
- * @return namespace name
- */
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * set namespace name.
- * @param namespace namespace name
- */
- public void setNamespace(final String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * get token.
- * @return token
- */
- public String getToken() {
- return token;
- }
-
- /**
- * set token.
- * @param token token
- */
- public void setToken(final String token) {
- this.token = token;
- }
-}
-
diff --git a/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepository.java b/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepository.java
deleted file mode 100644
index 94e8c22444c2..000000000000
--- a/shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepository.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * 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.registry.apollo;
-
-import com.ctrip.framework.apollo.Config;
-import com.ctrip.framework.apollo.ConfigChangeListener;
-import com.ctrip.framework.apollo.ConfigService;
-import com.ctrip.framework.apollo.core.ConfigConsts;
-import com.google.common.collect.Maps;
-import org.apache.shenyu.common.constant.Constants;
-import org.apache.shenyu.common.utils.GsonUtils;
-import org.apache.shenyu.registry.api.ShenyuInstanceRegisterRepository;
-import org.apache.shenyu.registry.api.config.RegisterConfig;
-import org.apache.shenyu.registry.api.entity.InstanceEntity;
-import org.apache.shenyu.registry.api.path.InstancePathConstants;
-import org.apache.shenyu.spi.Join;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-/**
- * The type apollo instance register repository.
- */
-@Join(isSingleton = false)
-public class ApolloInstanceRegisterRepository implements ShenyuInstanceRegisterRepository {
-
- private static final String APOLLO_CLUSTER = "apollo.cluster";
-
- private static final String PROP_APP_ID = "app.id";
-
- private static final String PROP_APOLLO_META = "apollo.meta";
-
- private static final String APOLLO_NAMESPACE = "apollo.bootstrap.namespace";
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ApolloInstanceRegisterRepository.class);
-
- private ApolloClient apolloClient;
-
- private final Map configChangeListenerMap = Maps.newConcurrentMap();
-
- private final Map> watcherInstanceRegisterMap = new ConcurrentHashMap<>();
-
- private String namespace;
-
- private Config configService;
-
- @Override
- public void init(final RegisterConfig config) {
- Properties properties = config.getProps();
- String meta = config.getServerLists();
- String appId = properties.getProperty("appId", "shenyu");
- String clusterName = properties.getProperty("clusterName", ConfigConsts.CLUSTER_NAME_DEFAULT);
- String namespace = properties.getProperty("namespace", ConfigConsts.NAMESPACE_APPLICATION);
- Optional.ofNullable(appId).ifPresent(x -> System.setProperty(PROP_APP_ID, x));
- Optional.ofNullable(meta).ifPresent(x -> System.setProperty(PROP_APOLLO_META, x));
- Optional.ofNullable(clusterName).ifPresent(x -> System.setProperty(APOLLO_CLUSTER, x));
- Optional.ofNullable(namespace).ifPresent(x -> System.setProperty(APOLLO_NAMESPACE, x));
- Optional.ofNullable(namespace).ifPresent(x -> System.setProperty(APOLLO_NAMESPACE, x));
- this.namespace = namespace;
- this.configService = ConfigService.getAppConfig();
- buildClient(config);
- }
-
- private void buildClient(final RegisterConfig config) {
- // init apollo client
- Properties properties = config.getProps();
- String appId = properties.getProperty("appId");
- String token = properties.getProperty("token");
- String env = properties.getProperty("env", "DEV");
- String clusterName = properties.getProperty("clusterName", ConfigConsts.CLUSTER_NAME_DEFAULT);
- String namespace = properties.getProperty("namespace", ConfigConsts.NAMESPACE_APPLICATION);
- String portalUrl = properties.getProperty("portalUrl", "http://localhost:8070");
- ApolloConfig apolloConfig = new ApolloConfig();
- apolloConfig.setAppId(appId);
- apolloConfig.setPortalUrl(portalUrl);
- apolloConfig.setToken(token);
- apolloConfig.setEnv(env);
- apolloConfig.setClusterName(clusterName);
- apolloConfig.setNamespace(namespace);
- this.apolloClient = new ApolloClient(apolloConfig);
- }
-
- @Override
- public void persistInstance(final InstanceEntity instance) {
- String instanceNodeName = buildInstanceNodeName(instance);
- String instancePath = InstancePathConstants.buildInstanceParentPath(instance.getAppName());
- String realNode = InstancePathConstants.buildRealNode(instancePath, instanceNodeName);
- String nodeData = GsonUtils.getInstance().toJson(instance);
- apolloClient.createOrUpdateItem(realNode, nodeData, "register instance");
- apolloClient.publishNamespace(namespace, "publish instance");
- LOGGER.info("apollo instance register success: {}", nodeData);
- }
-
- @Override
- public List selectInstances(final String selectKey) {
- final String watchKey = InstancePathConstants.buildInstanceParentPath(selectKey);
-
- final Function