Skip to content

Commit

Permalink
first-plugin-demo修改
Browse files Browse the repository at this point in the history
  • Loading branch information
daizhenyu committed Jan 4, 2024
1 parent 0b7f2da commit 2cc6ee7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,14 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-mq-consume-prohibition-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-mq-consume-prohibition-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
- name: Upload Release first-plugin-demo # first-plugin-demo release包
id: upload-release-asset-first-plugin
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/result/sermant-examples-first-plugin-demo-${{ env.version }}.tar.gz
asset_name: sermant-examples-first-plugin-demo-${{ env.version }}.tar.gz
asset_content_type: application/tar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| 示例名称 | 插件文档 | 示例项目 |
|:------------------:|:------------------------------------------------------------------------------------:|:------------------------------------------------:|
| 去源码插件开发模板 | [去源码插件开发说明](https://sermant.io/zh/document/developer-guide/) | [sermant-template](./sermant-template) |
| 去源码插件开发模板 | [去源码插件开发说明](https://sermant.io/zh/document/developer-guide/) | [first-plugin-demo](./first-plugin-demo) |
| 动态配置插件使用示例 | [动态配置插件使用说明](https://sermant.io/zh/document/plugin/dynamic-config.html) | [flowcontrol-demo](./flowcontrol-demo) |
| 流控插件使用示例 | [流控插件使用说明](https://sermant.io/zh/document/plugin/flowcontrol.html) | [flowcontrol-demo](./flowcontrol-demo) |
| 无损上下线插件使用示例 | [无损上下线插件使用说明](https://sermant.io/zh/document/plugin/graceful.html) | [grace-demo](./grace-demo) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ public void process(DynamicConfigEvent event) {
System.out.println("插件配置项发生变化,配置项值为:" + event.getContent());
}
});

// 用于动态配置演示
dynamicConfigService.addConfigListener("demo", "app=default",
new DynamicConfigListener() {
@Override
public void process(DynamicConfigEvent event) {
System.out.println("插件配置项发生变化,配置项值为:" + event.getContent());
}
});
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.0.0</version>
<packaging>pom</packaging>
<modules>
<module>sermant-template</module>
<module>first-plugin-demo</module>
<module>registry-demo</module>
<module>router-demo</module>
<module>flowcontrol-demo</module>
Expand Down
4 changes: 4 additions & 0 deletions scripts/copy_jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ mkdir -p package/springboot-registry-demo
mkdir -p package/visibility-demo
mkdir -p package/removal-demo
mkdir -p package/mq-consume-prohibition-demo
mkdir -p package/first-plugin-demo

# 按照文件名模式将对应的jar文件复制到对应目录
# 创建首个插件
find . -type d -name "agent" -exec cp -rv {} package/first-plugin-demo/ \;
# 动态配置
find . -type f -name "spring-provider.jar" -exec cp -v {} package/dynamic-demo/ \;
# 流控
Expand Down Expand Up @@ -65,6 +68,7 @@ find . -type f -name "rest-provider.jar" -exec cp -v {} package/removal-demo/ \;


# 打包
tar -czvf package/result/sermant-examples-first-plugin-demo-$*.tar.gz -C package/first-plugin-demo/ .
tar -czvf package/result/sermant-examples-dynamic-demo-$*.tar.gz -C package/dynamic-demo/ .
tar -czvf package/result/sermant-examples-flowcontrol-demo-$*.tar.gz -C package/flowcontrol-demo/ .
tar -czvf package/result/sermant-examples-grace-demo-$*.tar.gz -C package/grace-demo/ .
Expand Down

0 comments on commit 2cc6ee7

Please sign in to comment.