I logged a ticket to improve this https://issues.apache.org/jira/browse/CAMEL-9457
On Tue, Dec 29, 2015 at 9:31 AM, Claus Ibsen <claus.ib...@gmail.com> wrote: > This is expected, a jmx stop is only stopping camel, not the jvm. > > On Tue, Dec 29, 2015 at 9:25 AM, rno <romanno...@gmx.at> wrote: >> The camel version is as follows: 2.16.1 >> >> Shutdown log after JMX "camel"/stop >> 2015-12-29 09:23:11,727 [Thread-5 ] INFO >> DefaultShutdownStrategy - - - Graceful shutdown >> of 5 routes com >> pleted in 0 seconds >> 2015-12-29 09:23:11,739 [Thread-5 ] INFO SpringCamelContext >> - - - Apache Camel 2.16.1 (CamelContext >> : camel) uptime 15.556 seconds >> 2015-12-29 09:23:11,739 [Thread-5 ] INFO SpringCamelContext >> - - - Apache Camel 2.16.1 (CamelContext >> : camel) is shutdown in 0.031 seconds >> >> This last part only appears in the log after ctrl+c: >> 2015-12-29 09:23:35,189 [Thread-0 ] INFO >> MainSupport$HangupInterceptor - - - Received hang up >> - stopping the m >> ain instance. >> 2015-12-29 09:23:35,189 [Thread-0 ] INFO >> ClassPathXmlApplicationContext - - - Closing >> org.springframework.conte >> xt.support.ClassPathXmlApplicationContext@515f550a: startup date [Tue Dec 29 >> 09:22:50 CET 2015]; root of context hierarchy >> >> My startup code looks like this: >> public class MyRouteBuilder extends RouteBuilder { >> >> // if you want to shutdown the program: main.setDuration(10000); // in ms >> public static void main(String[] args) throws Exception { >> org.apache.camel.spring.Main main = new Main(); >> main.addMainListener(new Events()); >> main.enableHangupSupport(); >> main.run(); >> } >> >> public static class Events extends MainListenerSupport { >> >> // this never gets called! So process hangs, routes stop though >> // if this gets called you probably do not need this :) >> @Override >> public void afterStop(MainSupport main) { >> System.exit(1); >> } >> } >> >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/MainListenerSupport-afterStop-is-never-called-spring-Main-tp5775458p5775561.html >> Sent from the Camel - Users mailing list archive at Nabble.com. > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2