yhs0092 commented on issue #1918: URL: https://github.com/apache/servicecomb-java-chassis/issues/1918#issuecomment-673925432
建议查看一下`SCBEngine#doDestroy`方法的代码,Java-Chassis 向 JVM 注册了 shutdown hook 来进行进程退出前的终止操作,称为 优雅停机。它基本符合你的描述。 如果你想要感知服务进程退出的并做一些自定义的操作的话,可以监听`BootListener`中定义的`BEFORE_CLOSE`事件。 PS:`SCBEngine#blockShutDownOperationForConsumerRefresh`方法可以在微服务进程退出时阻塞住退出线程一段时间,给 consumer 端实例留出从 sc 感知 provider 实例下线的时间。可以试用一下这个功能,看看是否适合你的部署场景。 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
