camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raffi <>
Subject Shutdown hook in FatJarRouter - Springboot
Date Wed, 09 Dec 2015 21:34:38 GMT

I'm using Camel 2.16.0 with springboot 1.2.6-RELEASE, the app is packaged
and executed using FatJarRouter.

My routes run properly, but I'm having an issue with shutdown. I can
shutdown Camel using setShutdownNowOnTimeout() via JMX, that's not a
problem. But when shutting down Springboot using http://.../shutdown, it
gets stuck closing 'metricsExecutor' pool, and the JVM does not exit. I
don't believe this problem is related to Camel, but to address it, I want to
test shutting down this thread pool manually, so I need a way to hook into
the springboot's shutdown process.

##last line in log file where JVM hangs
2015-12-09 13:27:56,607 INFO  ThreadPoolTaskExecutor - Shutting down
ExecutorService 'metricsExecutor'

This is how we launch Camel in Springboot using FatJarRouter; can I hook
into the shutdown process to close 'metricsExecutor' bean manually?

public class MySpringBootRouter extends FatJarRouter {

   public static void main(String[] options){
      MySpringBootRouter router = new MySpringBootRouter();


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message