-
Notifications
You must be signed in to change notification settings - Fork 512
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
使用静态部署方案启动基座时,如果基座依赖了OpenFeign,会在基座refresh context期间触发ContextRefreshedEvent,导致模块被提前部署,基座启动失败 #1032
Comments
模块和基座使用不同的端口呢, 我们的做法就是让的模块和基座使用不同端口 |
使用不同的端口只是避免了端口冲突,但本质上还是不符合预期的,模块在部署的时候因为拿不到基座的tomcat启动信息,就会使用默认8080端口。虽然部署成功了,但是模块会触发二次部署,然后会报context path not unique的错误,你们没遇到这个错么 |
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue or help wanted. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue or help wanted. Thank you for your contributions. |
通过将基座和模块合并打包的方式进行静态部署,基座项目使用OpenFeign远程调用模块,在基座应用执行到refreshContext时,FeignClient初始化会创建AnnotationConfigApplicationContext,并触发ContextRefreshedEvent事件,导致ArkDeployStaticBizListener消费事件后执行了模块的静态部署。由于此时基座还没有启动完成,导致最终基座的tomcat启动报错,端口被占用。
debug代码发现此异常场景ArkDeployStaticBizListener消费的事件的applicationContext对象的类型和正常部署场景下的不同。异常情况下的类型是AnnotationConfigApplicationContext
正常情况下context类型是AnnotationConfigServletWebServerApplicationContext
建议ArkDeployStaticBizListener在执行deployStaticBizAfterEmbedMasterBizStarted前增加applicationContext的类型判断,避免模块部署被提前执行。这是具体的修复方案
或者将消费的Event类型改为根StaticBatchInstallEventListener一样的ApplicationReadyEvent,并且加上重复部署的判断。
The text was updated successfully, but these errors were encountered: