You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by kele6413430 <ke...@163.com> on 2019/07/24 14:05:31 UTC

add a interface GraceFullShutDown to supoort customized action in shutdown

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

Re: add a interface GraceFullShutDown to supoort customized action in shutdown

Posted by Ian Luo <ia...@gmail.com>.
Tiantian,

I can review it in the next week.

Thanks,
-Ian.


On Wed, Jul 24, 2019 at 10:05 PM kele6413430 <ke...@163.com> wrote:

> 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