Skip to content

Commit 16e8d79

Browse files
authored
refactor: externalize Polaris to plugin store (#7509)
Signed-off-by: cloudbase-ai <22498243+cloudbase-ai@users.noreply.github.com> Co-authored-by: cloudbase-ai <22498243+cloudbase-ai@users.noreply.github.com>
1 parent 6717830 commit 16e8d79

41 files changed

Lines changed: 54 additions & 2543 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Apache ShenYu is a Java-based gateway for service proxying, protocol conversion,
3838
| 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. |
3939
| 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)). |
4040
| Caching and transformation | In-memory or Redis-backed response caching, URL rewriting, redirection, and request/response transformation. |
41-
| Dynamic configuration | Admin persists plugins, selectors, rules, metadata, and authentication data. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos, etcd, Consul, Apollo, and Polaris are available. Gateway replicas apply updates to their local caches. |
41+
| Dynamic configuration | Admin persists plugins, selectors, rules, metadata, and authentication data. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos, etcd, Consul, and Apollo are available. Gateway replicas apply updates to their local caches. |
4242
| Observability | Metrics and logging plugins, including Kafka, Pulsar, Elasticsearch, and ClickHouse destinations; email and DingTalk alerts from Admin. |
4343
| 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. |
4444

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
# Draft: Polaris Plugin Store Migration and Rollback
19+
20+
This draft records the root-repository handoff for the Polaris plugin-store extension. Root publishing and aggregator wiring remain separate review steps.
21+
22+
The plugin store owns these Polaris artifacts:
23+
24+
- `shenyu-admin-listener-polaris`
25+
- `shenyu-sync-data-polaris`
26+
- `shenyu-registry-polaris`
27+
- `shenyu-spring-boot-starter-sync-data-polaris`
28+
29+
The validated store lane targets ShenYu API artifacts `2.7.2-SNAPSHOT` and Polaris SDK `1.13.0`. Real-server tests use Docker API `1.44` (selected with `-Dapi.version=1.44`) and the pinned Polaris standalone image `polarismesh/polaris-standalone@sha256:22c75382080a260e5d9fc9839b6657ae73f3154e308b8da881e1fab58653911c`.
30+
31+
## Migration draft
32+
33+
1. Review and publish the plugin-store Polaris artifacts.
34+
2. Wire the root aggregator, dependency management, and CI paths only after store artifact ownership is approved.
35+
3. Add the Polaris sync starter to gateways that should consume Polaris-backed sync data.
36+
4. Configure admin listener and gateway sync settings with the same Polaris config namespace and file group.
37+
5. Configure registry clients with the Polaris naming gRPC address when Polaris instance discovery is required.
38+
6. Roll admin listener changes before gateway consumers so config files exist before gateways subscribe.
39+
40+
## Rollback draft
41+
42+
1. Stop Polaris listener writes and restore the previous admin sync channel.
43+
2. Roll gateways back to the previous sync-data starter and settings.
44+
3. Roll registry clients back to the previous registry implementation.
45+
4. Keep Polaris config and naming state until no clients depend on it, then clean it up operationally.
46+
47+
## Tested boundary
48+
49+
The store real-server tests prove the config path from `PolarisDataChangedListener` through the real Polaris config SDK into `PolarisSyncDataService`, `BaseDataCache`, and a real `ShenyuWebHandler` test server. They cover create, update, delete, recreate, close, and fresh-subscriber recovery.
50+
51+
The registry real-server test proves `PolarisInstanceRegisterRepository` can register and query an instance against a real Polaris naming server, deregister that instance through the Polaris SDK boundary, observe removal through a fresh repository query, and close clients.
52+
53+
The tests do not start the full `shenyu-admin` Spring Boot app, do not cover dashboard or database persistence, and do not cover client annotation registration flows.

‎pom.xml‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
<eureka.version>2.0.2</eureka.version>
162162
<javatuples.version>1.2</javatuples.version>
163163
<k8s-client.version>17.0.2</k8s-client.version>
164-
<polaris.version>1.13.0</polaris.version>
165164
<bytebuddy.version>1.14.11</bytebuddy.version>
166165
<spring-ldap.version>2.3.4.RELEASE</spring-ldap.version>
167166
<jaxb.api.version>2.3.1</jaxb.api.version>
@@ -384,12 +383,6 @@
384383
<version>${apollo.version}</version>
385384
</dependency>
386385

387-
<dependency>
388-
<groupId>com.tencent.polaris</groupId>
389-
<artifactId>polaris-all</artifactId>
390-
<version>${polaris.version}</version>
391-
</dependency>
392-
393386
<dependency>
394387
<groupId>com.github.pagehelper</groupId>
395388
<artifactId>pagehelper</artifactId>

‎shenyu-admin-listener/pom.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<module>shenyu-admin-listener-consul</module>
3434
<module>shenyu-admin-listener-etcd</module>
3535
<module>shenyu-admin-listener-nacos</module>
36-
<module>shenyu-admin-listener-polaris</module>
3736
<module>shenyu-admin-listener-zookeeper</module>
3837
</modules>
3938

‎shenyu-admin-listener/shenyu-admin-listener-polaris/pom.xml‎

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎shenyu-admin-listener/shenyu-admin-listener-polaris/src/main/java/org/apache/shenyu/admin/config/PolarisSyncConfiguration.java‎

Lines changed: 0 additions & 101 deletions
This file was deleted.

‎shenyu-admin-listener/shenyu-admin-listener-polaris/src/main/java/org/apache/shenyu/admin/config/properties/PolarisProperties.java‎

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)