Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Camel: Notification on CamelContext stop

How can I get a notification when a CamelContext is stopped, the API has addStartupListener but nothing similar for when the context is stopped?

like image 558
Yazan Jaber Avatar asked Feb 15 '26 01:02

Yazan Jaber


1 Answers

this is one of the ways

    camelContext.addLifecycleStrategy(new LifecycleStrategySupport() {
        @Override
        public void onContextStop(CamelContext context) {
        }
    });

see more in Claus Ibsen's answer, he is the author of Camel in Action http://www.manning.com/ibsen/

like image 71
Evgeniy Dorofeev Avatar answered Feb 16 '26 15:02

Evgeniy Dorofeev