Change upload plugin 2 (#908)
* add plugin jar
* change_upload_plugin_2
diff --git a/docs/developer/custom-plugin.md b/docs/developer/custom-plugin.md
index f4091e3..a863107 100644
--- a/docs/developer/custom-plugin.md
+++ b/docs/developer/custom-plugin.md
@@ -310,55 +310,9 @@
* use `ShenyuAdmin - BasicConfig - Plugin` add plugin in `pluginJar` click upload button
* Custom ShenyuPlugin can be started by loading third-party jars into the `-cp` directory if it depends on other third-party packages in shenyu-bootstrap
-Tips: The Upload jar plugin does not support hot loading.
-If you need to modify the jar online. You can make a new jar. Go through the above steps again. The class name cannot be duplicated from the last upload
-plugin uploaded for the first time
+Tips:
-```java
-public class CustomPluginV1 extends AbstractShenyuPlugin {
- private static final Logger LOG = LoggerFactory.getLogger(CustomPluginV1.class);
+The Upload jar package plugin supports hot loading
+If you need to modify the jar online. You can make a new jar. And raise the version number, for example '1.0.1' to '1.0.2'
- protected Mono<Void> doExecute(ServerWebExchange exchange, ShenyuPluginChain chain, SelectorData selectorData, RuleData rule) {
- LOG.info(".......... function plugin start CustomPluginV1............");
- return chain.execute(exchange);
- }
-
- @Override
- public int getOrder() {
- return 0;
- }
-
- @Override
- public String named() {
- return "CustomPluginV1";
- }
-}
-```
-
-Now we need to change it
-
-Delete CustomPluginV1 in the admin interface
-
-And recreate CustomPluginV2
-
-```java
-public class CustomPluginV2 extends AbstractShenyuPlugin {
- private static final Logger LOG = LoggerFactory.getLogger(CustomPluginV2.class);
-
- protected Mono<Void> doExecute(ServerWebExchange exchange, ShenyuPluginChain chain, SelectorData selectorData, RuleData rule) {
- LOG.info(".......... function plugin start CustomPluginV2............");
- return chain.execute(exchange);
- }
-
- @Override
- public int getOrder() {
- return 0;
- }
-
- @Override
- public String named() {
- return "CustomPluginV2";
- }
-}
-```
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/developer/custom-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/current/developer/custom-plugin.md
index c34c81b..4f1cd7d 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/developer/custom-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/developer/custom-plugin.md
@@ -317,55 +317,8 @@
* 进入 ShenyuAdmin - BasicConfig - Plugin 进行添加 plugin 在 pluginJar 中可以添加自定义的 plugin Jar 包
* 自定义的 ShenyuPlugin 如果依赖了其他的第三方包可以 ShenyuBootstrap 启动是加载到 -cp 的第三方jar包目录
-注意: 上传jar包插件不支持热加载.
-如果你需要在线修改jar包. 你可以重新打一个jar包.把上述步骤重新走一遍.这里的类名不能与上次上传相重复
+注意:
-第一次上传的 plugin
+上传jar包插件支持热加载
+如果你需要在线修改jar包. 你可以重新打一个jar包. 并且提升版本号, 例如 `1.0.1` 升高至 `1.0.2`
-```java
-public class CustomPluginV1 extends AbstractShenyuPlugin {
- private static final Logger LOG = LoggerFactory.getLogger(CustomPluginV1.class);
-
- protected Mono<Void> doExecute(ServerWebExchange exchange, ShenyuPluginChain chain, SelectorData selectorData, RuleData rule) {
- LOG.info(".......... function plugin start..CustomPluginV1............");
- return chain.execute(exchange);
- }
-
- @Override
- public int getOrder() {
- return 0;
- }
-
- @Override
- public String named() {
- return "CustomPluginV1";
- }
-}
-```
-
-此时需要修改
-
-在admin 界面 删除 CustomPluginV1
-
-并且重新创建 CustomPluginV2
-
-```java
-public class CustomPluginV2 extends AbstractShenyuPlugin {
- private static final Logger LOG = LoggerFactory.getLogger(CustomPluginV2.class);
-
- protected Mono<Void> doExecute(ServerWebExchange exchange, ShenyuPluginChain chain, SelectorData selectorData, RuleData rule) {
- LOG.info(".......... function plugin start..CustomPluginV2............");
- return chain.execute(exchange);
- }
-
- @Override
- public int getOrder() {
- return 0;
- }
-
- @Override
- public String named() {
- return "CustomPluginV2";
- }
-}
-```