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
32 changes: 9 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,57 +24,44 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
java: [ 8, 11, 17 ]
java: [ 8, 17, 21, 23, 25 ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
if: (github.repository == 'apache/shenyu-client-java')
steps:
- name: Support longpaths
if: ${{ matrix.os == 'windows-latest'}}
run: git config --system core.longpaths true
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
# - uses: dorny/paths-filter@v2
# id: filter
# with:
# filters: '.github/filters.yml'
# list-files: json
- name: Restore ShenYu Maven Repos
# if: steps.filter.outputs.changed == 'true'
id: restore-maven-cache
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
# if: steps.filter.outputs.changed == 'true'
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Build with Maven
# if: steps.filter.outputs.changed == 'true'
run: ./mvnw -B clean test -Prelease
- uses: codecov/codecov-action@v1
run: ./mvnw -B clean test
- uses: codecov/codecov-action@v4
with:
token: 2760af6a-3405-4882-9e61-04c5176fecfa
# if: steps.filter.outputs.changed == 'true'
- name: Save ShenYu Maven Repos
# if: steps.filter.outputs.changed == 'true' && steps.restore-maven-cache.outputs.cache-hit != 'true'
if: steps.restore-maven-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

check-license-header:
name: check-license-header
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Check License Header
Expand All @@ -92,4 +79,3 @@ jobs:
- name: checking job status
run: |
[[ "${{ needs.build.result }}" == "success" ]] || exit -1

47 changes: 46 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
<packaging>pom</packaging>
<version>2.7.0.1-jdk8-SNAPSHOT</version>
<modules>
<module>shenyu-registry-api</module>
<module>shenyu-client-core</module>
<module>shenyu-client-http</module>
<module>shenyu-client-mcp</module>
<module>shenyu-client-dubbo</module>
<module>shenyu-client-sofa</module>
<module>shenyu-client-tars</module>
Expand All @@ -39,15 +41,46 @@
<module>shenyu-client-websocket</module>
<module>shenyu-client-api-docs-annotations</module>
<module>shenyu-client-autoconfig</module>
<module>shenyu-register-client-beat</module>
<module>shenyu-spring-boot-starter-client</module>
</modules>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>https://github.com/apache/shenyu-client-java</url>
<connection>scm:git:https://github.com/apache/shenyu-client-java.git</connection>
<developerConnection>scm:git:https://github.com/apache/shenyu-client-java.git</developerConnection>
<tag>HEAD</tag>
</scm>

<mailingLists>
<mailingList>
<name>Apache ShenYu Developer List</name>
<post>dev@shenyu.apache.org</post>
<subscribe>dev-subscribe@shenyu.apache.org</subscribe>
<unsubscribe>dev-unsubscribe@shenyu.apache.org</unsubscribe>
</mailingList>
</mailingLists>

<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/apache/shenyu/issues</url>
</issueManagement>

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipTests>false</skipTests>
<!-- maven plugin version start -->
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.3</nexus-staging-maven-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
Expand Down Expand Up @@ -87,7 +120,9 @@
<okhttp.version>4.9.3</okhttp.version>
<bcprov-jdk18on.version>1.78</bcprov-jdk18on.version>
<mockito.version>3.5.15</mockito.version>
<byte-buddy.version>1.18.10</byte-buddy.version>
<awaitility.version>4.0.3</awaitility.version>
<swagger-core.version>2.2.21</swagger-core.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -168,6 +203,16 @@
<artifactId>bcprov-jdk18on</artifactId>
<version>${bcprov-jdk18on.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
51 changes: 51 additions & 0 deletions progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Client Split Migration Progress

## Baseline

- Working branch: `split-client-jdk8-base`
- Base branch: `origin/2.7.0.1-jdk8-release`
- Goal: keep the split client repository JDK 8 compatible while preparing it to absorb client-only changes from the main ShenYu repository.

## Done

- Selected the existing `2.7.0.1-jdk8-release` branch as the migration base because it already preserves Java 8 source level and Apache release metadata.
- Added the MCP client module from the main ShenYu repository.
- Rebased MCP module POMs onto `shenyu-client-java` and removed Spring Boot 3 / springdoc starter coupling.
- Added MCP registration DTO, disruptor subscriber, RPC/data types, and HTTP register path support in `shenyu-client-core`.
- Added a Java 8 compatible `RequestMethodUtils` for MCP method and parameter discovery.
- Added the Spring Boot starter client modules from the main ShenYu repository.
- Rebased starter POMs onto this split client repo and rewired imports to `shenyu-client-core`.
- Restored the beat register client and beat Spring Boot starter.
- Restored the registry API module needed by instance registration.
- Restored Spring MVC, gRPC, and Spring WebSocket discovery instance auto-configuration.
- Added the minimal client-core DTO/config/registry support needed by beat and discovery without pulling in the full main-repo `shenyu-common` module.
- Updated GitHub Actions CI to run the Maven build on JDK 8, 17, 21, 23, and 25.
- Kept the SOFA starter test dependency on the JDK 8 compatible SOFA Boot 3.1.4 line.
- Upgraded JaCoCo to 0.8.15 so coverage instrumentation recognizes JDK 25 class files.
- Overrode Byte Buddy test dependencies to 1.18.10 so Mockito 3.x tests can run on JDK 21, 23, and 25 while preserving JDK 8 runtime compatibility.

## Verification

- `./mvnw -pl shenyu-client-mcp/shenyu-client-mcp-register -am -DskipTests compile` passed.
- `./mvnw -pl shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-beat -am -DskipTests compile` passed.
- `./mvnw -DskipTests compile` passed.
- `./mvnw -DskipTests test` passed.
- `./mvnw -pl shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-springmvc -am test` passed.
- `./mvnw test` passed across the full 30-module reactor.
- `JAVA_HOME=$(/usr/libexec/java_home -v 1.8) ./mvnw -B clean test -Prelease` passed across the full 30-module reactor.
- `JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -B clean test -Prelease` passed across the full 30-module reactor.
- `JAVA_HOME=$(/usr/libexec/java_home -v 21) ./mvnw -B clean test -Prelease` passed across the full 30-module reactor.
- `JAVA_HOME=$(/usr/libexec/java_home -v 25) ./mvnw -B clean test` passed across the full 30-module reactor after the JaCoCo and Byte Buddy upgrades.
- Downloaded Temurin JDK 23.0.2+7 from Adoptium to `/tmp/shenyu-jdks`, verified SHA256 `749993e751f085c7ae713140066a90800075e4aeedfac50a5ed0c5457131c5a0`, and ran `JAVA_HOME=/tmp/shenyu-jdks/jdk-23.0.2+7/Contents/Home ./mvnw -B clean test` successfully across the full 30-module reactor.
- Re-ran `JAVA_HOME=$(/usr/libexec/java_home -v 1.8) ./mvnw -B clean test` successfully after the JaCoCo and Byte Buddy upgrades.
- The CI command now omits `-Prelease` because Maven reports that profile does not exist in this split repository.
- `.github/workflows/ci.yml` YAML parsing passed.
- Compatibility scan found no remaining old `org.apache.shenyu.common`, `org.apache.shenyu.register.common`, `org.apache.shenyu.register.client.http`, or `jakarta.*` imports in the restored beat/discovery code.
- Java 8 syntax scan found no `List.of`, `Map.of`, `Set.of`, or pattern-matching `instanceof` usage in the migrated MCP/starter modules.
- The full test run still logs existing background exceptions from original async tests under JDK 17, but Surefire reports reactor success.

## Next Steps

- Confirm the expanded GitHub Actions matrix on the remote runner after opening the pull request.
- Verify beat and discovery instance registration against matching admin/bootstrap runtime.
- Verify `/shenyu-client/register-mcp` against the matching admin side before treating MCP registration as end-to-end complete.
15 changes: 10 additions & 5 deletions shenyu-client-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@
<artifactId>shenyu-disruptor</artifactId>
<version>2.6.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.shenyu</groupId>-->
<!-- <artifactId>shenyu-spi</artifactId>-->
<!-- <version>2.6.1</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spi</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-registry-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.client.core.config;

import org.apache.shenyu.client.core.constant.Constants;

/**
* Minimal client-side ShenYu configuration used by heartbeat reporting.
*/
public class ShenyuConfig {

private String namespace = Constants.SYS_DEFAULT_NAMESPACE_ID;

public String getNamespace() {
return namespace;
}

public void setNamespace(final String namespace) {
this.namespace = namespace;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ public interface Constants {
*/
String HEARTBEAT = "heartbeat";

/**
* The constant BEAT_URI_PATH.
*/
String BEAT_URI_PATH = "/instance/beat";

/**
* The constant header key of sign plugin version-2.
*/
Expand Down Expand Up @@ -623,6 +628,16 @@ public interface Constants {
* When register by http, the uri path.
*/
String URI_PATH = "/shenyu-client/register-uri";

/**
* When register by http, the mcp tools path.
*/
String MCP_TOOLS_PATH = "/shenyu-client/register-mcp";

/**
* When register by http, the mcp tools type.
*/
String MCP_TOOLS_TYPE = "mcp";

/**
* When register by http, the offline path.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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.client.core.constant;

/**
* Instance type constants.
*/
public final class InstanceTypeConstants {

/**
* Bootstrap instance info type.
*/
public static final String BOOTSTRAP_INSTANCE_INFO = "bootstrapInstanceInfo";

private InstanceTypeConstants() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.shenyu.client.core.disruptor.executor.RegisterClientConsumerExecutor.RegisterClientExecutorFactory;
import org.apache.shenyu.client.core.disruptor.subcriber.ShenyuClientApiDocExecutorSubscriber;
import org.apache.shenyu.client.core.disruptor.subcriber.ShenyuClientMcpExecutorSubscriber;
import org.apache.shenyu.client.core.disruptor.subcriber.ShenyuClientMetadataExecutorSubscriber;
import org.apache.shenyu.client.core.disruptor.subcriber.ShenyuClientURIExecutorSubscriber;
import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
Expand Down Expand Up @@ -54,6 +55,7 @@ public void start(final ShenyuClientRegisterRepository shenyuClientRegisterRepos
factory.addSubscribers(new ShenyuClientMetadataExecutorSubscriber(shenyuClientRegisterRepository));
factory.addSubscribers(new ShenyuClientURIExecutorSubscriber(shenyuClientRegisterRepository));
factory.addSubscribers(new ShenyuClientApiDocExecutorSubscriber(shenyuClientRegisterRepository));
factory.addSubscribers(new ShenyuClientMcpExecutorSubscriber(shenyuClientRegisterRepository));
providerManage = new DisruptorProviderManage<>(factory);
providerManage.startup();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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.client.core.disruptor.subcriber;

import org.apache.shenyu.client.core.dto.McpToolsRegisterDTO;
import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
import org.apache.shenyu.client.core.register.subsriber.ExecutorTypeSubscriber;
import org.apache.shenyu.client.core.type.DataType;

import java.util.Collection;

/**
* The type Shenyu client mcp executor subscriber.
*/
public class ShenyuClientMcpExecutorSubscriber implements ExecutorTypeSubscriber<McpToolsRegisterDTO> {

private final ShenyuClientRegisterRepository shenyuClientRegisterRepository;

/**
* Instantiates a new Shenyu client mcp executor subscriber.
*
* @param shenyuClientRegisterRepository the shenyu client register repository
*/
public ShenyuClientMcpExecutorSubscriber(final ShenyuClientRegisterRepository shenyuClientRegisterRepository) {
this.shenyuClientRegisterRepository = shenyuClientRegisterRepository;
}

@Override
public void executor(final Collection<McpToolsRegisterDTO> dataList) {
dataList.forEach(shenyuClientRegisterRepository::persistMcpTools);
}

@Override
public DataType getType() {
return DataType.MCP_TOOLS;
}
}
Loading
Loading