Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[type:feature] Custome classloader hot load plugins to gateway. #5403

Open
wants to merge 134 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 110 commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
6e90c09
test
lahmXu Sep 13, 2023
6cff152
合并AbstractShenyuClassIsolation到AbstractShenyuPlugin类中
lahmXu Sep 14, 2023
3606286
调整代码
lahmXu Sep 17, 2023
3d5392e
加载插件到spring bean中
lahmXu Sep 19, 2023
2132596
fix
lahmXu Sep 21, 2023
25de55e
fix
lahmXu Sep 21, 2023
2c3fd4d
添加maven打包plugin配置,通过includeArtifactIds可以将需要的依赖放到自定义类加载器中
lahmXu Sep 25, 2023
2cf80d8
排除报错依赖
lahmXu Sep 27, 2023
6797b15
记录当前修改
lahmXu Oct 9, 2023
d9b2654
修复motan初始化失败问题
lahmXu Oct 13, 2023
e8e485a
解决序列化sofa请求参数失败问题
lahmXu Oct 16, 2023
16c41ab
feat: 将插件需要创建的对象交给spring去创建
lahmXu Oct 18, 2023
2a7e14d
feat: 增加releasa打包
lahmXu Oct 22, 2023
426cf37
[type:fix] refactor class isolation.
Oct 24, 2023
761ee11
Merge branch 'apache:master' into class_isolation
lahmXu Oct 24, 2023
303a704
[type:fix] refactor class isolation.
Oct 24, 2023
6729ebd
Merge remote-tracking branch 'lamuxu/class_isolation' into class_isol…
Oct 24, 2023
194e0f5
[type:fix] refactor class isolation.
Oct 24, 2023
fba3c97
[type:fix] refactor class isolation.
Oct 25, 2023
07600ca
[type:fix] refactor class isolation.
Oct 26, 2023
a55abe1
[type:fix] refactor class isolation.
Oct 26, 2023
ca78bcf
[type:fix] refactor class isolation.
Oct 26, 2023
62d12d5
fix: 增加motan插件
lahmXu Oct 26, 2023
ae8d6ab
[type:fix] refactor class isolation.
Oct 27, 2023
84dd81f
fix: 修改motan插件
lahmXu Oct 31, 2023
f98af5c
fix: 修改motan插件
lahmXu Oct 31, 2023
9e14994
Merge branch 'apache:master' into class_isolation
lahmXu Oct 31, 2023
746c65a
feat: 增加插件通用lib目录,增加maven构建时移除jar文件的功能
lahmXu Nov 3, 2023
f3e6760
feat: 改写request插件
lahmXu Nov 9, 2023
68d79f9
fix: 调整motan、sofa插件打包配置
lahmXu Nov 9, 2023
1cea6c0
fix: 调整motan插件
lahmXu Nov 16, 2023
6037fca
fix: 调整sofa插件
lahmXu Nov 17, 2023
b06629b
fix: 调整sofa插件
lahmXu Nov 20, 2023
e7eb2db
fix: 修复fatjar中包含多个pom.properties的问题
lahmXu Nov 29, 2023
3a278a1
fix: 加入motan-api依赖
lahmXu Nov 30, 2023
aab516b
Merge branch 'apache:master' into class_isolation
lahmXu Dec 7, 2023
91e3efb
fix: 开启motan、sofa插件的e2e测试
lahmXu Dec 26, 2023
ce56e38
fix: 调整e2e测试配置
lahmXu Dec 26, 2023
b4ce158
fix: 调整e2e测试配置
lahmXu Dec 26, 2023
23e701e
fix: 调整e2e测试配置
lahmXu Dec 26, 2023
d861c3e
fix: 修复checkstyle问题
lahmXu Dec 26, 2023
46351d6
fix: 开启motan e2e测试
lahmXu Dec 27, 2023
96d4781
fix: 修改motan插件的e2e测试
lahmXu Dec 28, 2023
5987a73
fix: 修改motan插件的e2e测试
lahmXu Dec 28, 2023
6fdedec
fix: 修改motan插件的e2e测试
lahmXu Dec 28, 2023
e1e358c
fix: 开启motan e2e测试
lahmXu Dec 28, 2023
b51f8af
fix: 开启motan e2e测试
lahmXu Dec 28, 2023
54b7904
fix: 修改motan插件的e2e测试
lahmXu Dec 28, 2023
46f6d92
fix: 修改motan插件的e2e测试
lahmXu Dec 28, 2023
bcf69d9
fix: 调整motan e2e测试
lahmXu Dec 28, 2023
55f9dde
fix: 修改motan插件的e2e测试
lahmXu Dec 28, 2023
ac92bb4
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
07918b1
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
5a979de
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
824bfcb
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
1161706
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
9976f94
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
0dea96b
fix: 修改motan插件的e2e测试
lahmXu Dec 29, 2023
6dfeb31
fix: 调整motan e2e测试
lahmXu Dec 30, 2023
350a945
fix: 修改motan插件的e2e测试
lahmXu Dec 30, 2023
a2b8936
fix: 修改motan插件的e2e测试
lahmXu Dec 30, 2023
3875a0c
fix: 修改motan插件的e2e测试
lahmXu Jan 9, 2024
ec2bfd2
fix: 修改motan插件的e2e测试
lahmXu Jan 9, 2024
d387a34
fix: 修改motan插件的e2e测试
lahmXu Jan 9, 2024
8744738
fix: 修改motan插件的e2e测试
lahmXu Jan 9, 2024
95cb3a6
fix: 修改motan插件的e2e测试
lahmXu Jan 10, 2024
d8b59e6
fix: 修改motan插件的e2e测试
lahmXu Jan 10, 2024
21d6e52
fix: 调整motan e2e测试
lahmXu Jan 10, 2024
3b48b63
feat: 合并代码
lahmXu Jan 11, 2024
52fce52
fix: 测试sofa e2e测试
lahmXu Jan 11, 2024
0a4ac1a
fix: 修改motan插件的e2e测试
lahmXu Jan 11, 2024
f128ce3
fix: 解决motan NoClassDefFoundError
lahmXu Jan 12, 2024
5ab2a77
fix: 修改motan插件的e2e测试
lahmXu Jan 12, 2024
2068aa6
fix: 修改motan插件的e2e测试
lahmXu Jan 12, 2024
fab3b73
fix: 修改motan插件的e2e测试
lahmXu Jan 12, 2024
232419e
fix: 修改motan插件的e2e测试
lahmXu Jan 12, 2024
5e7f0e8
fix: 修改motan插件的e2e测试
lahmXu Jan 12, 2024
2ba5986
fix: 打印endpoint日志
lahmXu Jan 13, 2024
70cc749
fix: 修改motan插件的e2e测试
lahmXu Jan 13, 2024
11030c8
fix: 修改motan插件的e2e测试
lahmXu Jan 15, 2024
6c0bad2
fix: 移除sofa、motan插件依赖
lahmXu Jan 15, 2024
7a1769e
fix: 修改sofa插件的e2e测试
lahmXu Jan 16, 2024
db4eee6
fix: 恢复shenyu git action配置
lahmXu Jan 17, 2024
c4e0938
fix: 恢复shenyu git action配置
lahmXu Jan 17, 2024
c0041a1
fix: 修复格式问题
lahmXu Jan 17, 2024
37050fc
fix: 修复格式问题
lahmXu Jan 17, 2024
ca0bf41
fix: 修复actions失败问题
lahmXu Jan 17, 2024
cab1654
fix: 修复actions失败问题
lahmXu Jan 17, 2024
46c7d91
fix: 修复actions失败问题
lahmXu Jan 17, 2024
e1da7f7
Merge branch 'master' into class_isolation
lahmXu Jan 17, 2024
7237fb4
fix: 修复actions失败问题
lahmXu Jan 18, 2024
cca9d2f
fix: 修复actions失败问题
lahmXu Jan 18, 2024
f958688
fix: 修复actions失败问题
lahmXu Jan 18, 2024
b3ae051
fix: 修复actions失败问题
lahmXu Jan 18, 2024
e7a17df
fix: 修复actions失败问题
lahmXu Jan 18, 2024
0daa58a
fix: 修复actions失败问题
lahmXu Jan 18, 2024
3e49b64
fix: 修复actions失败问题
lahmXu Jan 18, 2024
095c7b5
fix: 修复actions失败问题
lahmXu Jan 18, 2024
fc3fdeb
fix: 修复actions失败问题
lahmXu Jan 18, 2024
0705196
fix: 修复actions失败问题
lahmXu Jan 18, 2024
a54ef32
fix: 修复actions失败问题
lahmXu Jan 18, 2024
69caeaa
fix: 修复actions失败问题
lahmXu Jan 18, 2024
cd11b5b
fix: 修复actions失败问题
lahmXu Jan 22, 2024
fe3f057
fix: 合并master代码
lahmXu Jan 22, 2024
4d5cb41
fix: 合并master代码
lahmXu Jan 22, 2024
26f1e20
Merge branch 'master' into class_isolation
loongs-zhang Jan 22, 2024
8e30a51
fix: 合并master代码
lahmXu Feb 1, 2024
91d4cb1
fix: 调整shenyu-integrated-test-k8s-ingress-motan测试启动脚本
lahmXu Feb 1, 2024
b04a9a9
fix: 调整shenyu-integrated-test-k8s-ingress-motan测试启动脚本
lahmXu Feb 1, 2024
972b39c
fix: 调整shenyu-integrated-test-k8s-ingress-motan测试启动脚本
lahmXu Feb 1, 2024
8262cbf
fix: 调整代码
lahmXu Feb 28, 2024
f181162
fix: 调整代码
lahmXu Feb 28, 2024
1620f29
fix: 调整代码
lahmXu Feb 28, 2024
ed5b0b0
fix: 调整代码
lahmXu Feb 28, 2024
0fa97ca
fix: 修复格式问题
lahmXu Mar 4, 2024
914d7c8
Merge branch 'master' into class_isolation
lahmXu Mar 10, 2024
9827562
fix: 移除健康检查
lahmXu Mar 24, 2024
298b5a6
Merge branch 'master' into class_isolation
lahmXu Mar 24, 2024
198f193
fix: 合并代码
lahmXu Mar 24, 2024
a4b07bd
fix: 合并代码
lahmXu Mar 25, 2024
3246f39
fix: 合并代码
lahmXu Apr 1, 2024
8b2f414
fix: 移除isolation依赖,使用父加载器加载
lahmXu Apr 2, 2024
c599f37
feat: 合并代码
lahmXu Apr 2, 2024
774038f
fix: 移除 motan 依赖
lahmXu Apr 2, 2024
1924fb9
fix: 添加 sofa 版本
lahmXu Apr 2, 2024
eae5d7d
fix: 调整 motan 健康检测路径
lahmXu Apr 3, 2024
cccfd0b
fix: 移除健康检查
lahmXu Apr 3, 2024
6846805
fix: 移除健康检查
lahmXu Apr 3, 2024
9be7ff3
Merge branch 'master' into class_isolation
lahmXu Apr 15, 2024
506b34e
fix: 修复sofa单测问题
lahmXu Apr 17, 2024
0530f8e
Merge branch 'class_isolation' of https://github.com/lahmXu/shenyu in…
lahmXu Apr 17, 2024
0c8d0a5
fix: 解决冲突
lahmXu Apr 17, 2024
0f08c41
Merge branch 'master' of https://github.com/apache/shenyu into class_…
lahmXu Apr 20, 2024
a475652
fix: 修复缺少jakarta问题
lahmXu Apr 28, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/e2e-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ jobs:
script: e2e-springcloud-sync
- case: shenyu-e2e-case-apache-dubbo
script: e2e-apache-dubbo-sync
- case: shenyu-e2e-case-motan
script: e2e-motan-sync
- case: shenyu-e2e-case-sofa
script: e2e-sofa-sync
- case: shenyu-e2e-case-grpc
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependency-reduced-pom.xml
release.properties
cobertura.ser
*.gpg
plugins

# eclipse ignore
.settings/
Expand Down
90 changes: 33 additions & 57 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,30 +217,6 @@
<version>${bytebuddy.version}</version>
</dependency>

<dependency>
<groupId>com.weibo</groupId>
<artifactId>motan-core</artifactId>
<version>${motan.version}</version>
</dependency>

<dependency>
<groupId>com.weibo</groupId>
<artifactId>motan-transport-netty4</artifactId>
<version>${motan.version}</version>
</dependency>

<dependency>
<groupId>com.weibo</groupId>
<artifactId>motan-registry-zookeeper</artifactId>
<version>${motan.version}</version>
</dependency>

<dependency>
<groupId>com.weibo</groupId>
<artifactId>motan-springsupport</artifactId>
<version>${motan.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down Expand Up @@ -276,39 +252,6 @@
<version>${apache.dubbo.version}</version>
</dependency>

<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-rpc-all</artifactId>
<version>${sofa.rpc.version}</version>
<exclusions>
<exclusion>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
</exclusion>
<exclusion>
<artifactId>grpc-api</artifactId>
<groupId>io.grpc</groupId>
</exclusion>
<exclusion>
<artifactId>grpc-protobuf</artifactId>
<groupId>io.grpc</groupId>
</exclusion>
<exclusion>
<artifactId>grpc-stub</artifactId>
<groupId>io.grpc</groupId>
</exclusion>
<exclusion>
<artifactId>grpc-netty-shaded</artifactId>
<groupId>io.grpc</groupId>
</exclusion>
</exclusions>
</dependency>


<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
Expand Down Expand Up @@ -832,6 +775,39 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId>
<version>0.1</version>
<executions>
<execution>
<id>directories</id>
<goals>
<goal>highest-basedir</goal>
</goals>
<phase>initialize</phase>
<configuration>
<property>main.basedir</property>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>plugins</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>
38 changes: 38 additions & 0 deletions script/clean_duplicated_jar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

echo 'Remove duplicated jar files...'

# 获取第一个目录下的所有文件
dir1=$1
array1=($(find $dir1 -type f))

# 获取第二个目录下的所有文件
dir2=$2
array2=($(find $dir2 -type f))

# 遍历两个数组,检查是否存在重复的文件
for file in "${array1[@]}"; do
for otherfile in "${array2[@]}"; do
if [[ $(basename "$file") == $(basename "$otherfile") ]]; then
# 删除重复的文件
rm -f "$otherfile"
break;
fi
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public String getItemValue(final String key) {
return openItemDTO.getValue();
}


/**
* removeItemKey.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ public class DashboardProperties implements InitializingBean {
* record log limit.
*/
private Integer recordLogLimit = 12;



/**
* Only supports deleting logs older than a certain day.
* default is 3.
*/
private Integer onlyCleanDays = 3;



/**
* enable print api log..
* default is false.
Expand All @@ -64,14 +62,12 @@ public class DashboardProperties implements InitializingBean {
*/
private Boolean enableSuperAdminPasswordSafe = true;


/**
* enable SuperAdminPassword valid duration.
* default is 30 day
*/
private Long superAdminPasswordValidDuration = 30 * AdminConstants.THE_ONE_DAY_MILLIS_TIME;


/**
* Only the super administrator root user has the privileges.
* default is 3.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class CustomDiscoveryUpstreamParser implements JsonDeserializer<Discovery

private final Map<String, String> conversion;


/**
* CustomDiscoveryUpstreamParser.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public QueueConsumerExecutor<Collection<DataTypeParent>> create() {
public String fixName() {
return "shenyu_register_server";
}



/**
* Add subscribers abstract queue consumer factory.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;


/**
* Abstract class for ConfigEventListener.
* As we think that the md5 value of the in-memory data is the same as the md5 value of the database,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.shenyu.admin.model.bean;


/**
* CustomCode.
*/
Expand All @@ -29,7 +28,6 @@ public class CustomCode {

private String solution;


/**
* getCode.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public final class RegConstant {
*/
public static final String PASSWORD_RULE = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&#.=_+-])[A-Za-z\\d@$!%*?&#.=_+-]{8,}$";


/**
* At least 8 in length, containing at least one letter and one number.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public class DiscoveryUpstreamDTO implements Serializable {
*/
private Timestamp dateUpdated;


/**
* getId.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class FieldDTO implements Serializable {
*/
private Timestamp dateUpdated;


/**
* getModelId.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public int hashCode() {
return Objects.hash(super.hashCode(), fieldId, example, fieldValue, valueDesc);
}


/**
* builder.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ public PluginDOBuilder pluginJar(final byte[] pluginJar) {
return this;
}



/**
* build method.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ public DataEventTypeEnum getType() {
return type;
}


/**
* get color.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ public AdminDataModelChangedEvent(final Object source, final Object before, fina
this.consumed = false;
this.date = new Date();
}



/**
* get type.
*
Expand Down Expand Up @@ -139,8 +138,7 @@ public void consumed() {
public boolean isConsumed() {
return consumed;
}



/**
* get date.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
* BatchChangedEvent.
*/
public class BatchChangedEvent extends AdminDataModelChangedEvent {



/**
* Create a new {@code PluginChangedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/
public class BatchDictChangedEvent extends BatchChangedEvent {


/**
* Create a new {@code BatchDictChangedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ public String buildContext() {
return String.format("the dict[%s] is %s", data, StringUtils.lowerCase(getType().getType().toString()));
}



/**
* get deleted iss.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
public class DictChangedEvent extends AdminDataModelChangedEvent {


/**
* Create a new {@code DictChangedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class DictCreatedEvent extends DictChangedEvent {


/**
* Create a new {@code DictCreatedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class DictUpdatedEvent extends DictChangedEvent {


/**
* Create a new {@code DictUpdatedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/
public class BatchPluginHandleChangedEvent extends BatchChangedEvent {


/**
* Create a new {@code PluginChangedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
public class PluginHandleChangedEvent extends AdminDataModelChangedEvent {


/**
* Create a new {@code PluginChangedEvent}.operator is unknown.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/
public class BatchMetaDataChangedEvent extends BatchChangedEvent {


/**
* Create a new {@code BatchMetaDataChangedEvent}.operator is unknown.
*
Expand Down
Loading
Loading