Hello Dubbo Community, In shutdown stage of a project ,gracefull shut down is necessary. There is a application listener ,but it is not enough,some actions should be done with dubbo. For example, Kafka producer should flush messages to the broker after protocol destroyed. Another,MQ consumer should not poll new messages any more after registries destroyed.
So I make a pull request 1、add a interface GraceFulShutDown 2、update SpringExtensionFactory.ShutdownHookListener to support customized actions when spring bean exists which implements GraceFullShutDown 3.add a unit test GraceFulShutDownTest Link is below: https://github.com/apache/dubbo/pull/4606 Welcome to review the code and discuss about it. I use it to flush the cached Kafak messages to the broker after the dubbo protocol destroyed. Another,stop the poll loop in the message consumer I have used these code in the product enviorment and it works well. Wish to accept it ! Best regards, Tiantian Yuan
