sofa-ark
sofa-ark copied to clipboard
容器卸载biz提示成功,但biz的WEB接口仍然可访问
Describe the bug
容器卸载biz,提示成功,但WEB接口仍然可访问
Expected behavior
biz卸载后,相应的WEB接口应不存在
Actual behavior
依然可以访问
Steps to reproduce
- 容器添加WEB接口
@GetMapping("/install")
public Object install() throws Throwable {
URL bizUrl1 = this.getClass().getClassLoader()
.getResource("sample-ark-springboot2-1.0-SNAPSHOT-ark-biz.jar");
File bizFile = ArkClient.createBizSaveFile("sample-ark-springboot2", "1.0.0");
FileUtils.copyInputStreamToFile(bizUrl1.openStream(), bizFile);
ClientResponse response = ArkClient.installBiz(bizFile);
return response;
}
@GetMapping("/uninstall")
public Object uninst() throws Throwable {
ClientResponse response = ArkClient.uninstallBiz("sample-ark-springboot2", "1.0-SNAPSHOT");
return response;
}
- 复制粘贴
/sample-ark-springboot
,重命名sample-ark-springboot2
,并添加WEB接口,修改biz端口成8081
- 构建
mvn clean package
,将sample-ark-springboot2
相应的biz包,复制粘贴到容器的resources目录 - 再次构建
mvn clean package
- 通过
java -jar
方式启动容器 - 通过http请求
/install
接口,加载biz - 访问biz端口的web接口,正常
- 通过http请求
/uninstall
接口,卸载biz - 再次访问biz端口的web接口,依然可访问,从telnet中查看已没有这个biz
Environment
- SOFAArk version: 1.1.6
- JVM version (e.g.
java -version
): - OS version (e.g.
uname -a
): - Maven version:
- IDE version:
感谢反馈,@alaneuler @glmapper 帮忙看看哈
@haozi2015 是否有报错信息?可以关注下 ArkTomcatWebServer
@haozi2015 Hello,请问问题还有吗?
问问 lz :安装的 Web Server 类型的 Biz,需要设置新的端口吗(因为我自己跑的时候不修改端口会跟宿主应用冲突)
如果有不同版本biz包存在但未激活,web接口仍可以访问
这个问题怎么解决的
@AmarisEx web server 类型的 Biz 应用嵌入到基座有两种模式:多 Host 与单 Host 模式。 多 Host 需要 Biz 应用设置新端口,单 Host 不需要设置新端口,而是需要 Biz 应用设置 webContextPath。具体可以看下这个文档:https://www.sofastack.tech/projects/sofa-boot/sofa-ark-spring-boot-demo/ @haozi2015 @wangxiaotao00 @zhangqianz 目前 Sofa boot 支持动态卸载,Spring boot 不支持动态卸载。如果 Spring boot 应用要动态卸载,需要注册一个卸载的事件handler,请参考 sofaboot 的代码:SofaBizUninstallEventHandler。同 #554
问题过久,先关闭,有需要再 Reopen。