Claus Ibsen created CAMEL-14198: ----------------------------------- Summary: camel-spring-boot - Can restart routes on startup if using run-main-controller Key: CAMEL-14198 URL: https://issues.apache.org/jira/browse/CAMEL-14198 Project: Camel Issue Type: Bug Components: camel-spring-boot Affects Versions: 3.0.0.RC3 Reporter: Claus Ibsen Fix For: 3.0.0
For example running camel-example-spring-boot-activemq, see the logs on startup 2019-11-21 09:59:46.507 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootRoutesCollector : Loading additional Camel XML routes from: classpath:camel/*.xml 2019-11-21 09:59:46.508 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootRoutesCollector : Loading additional Camel XML rests from: classpath:camel-rest/*.xml 2019-11-21 09:59:46.512 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootCamelContext : Apache Camel 3.0.0-SNAPSHOT (CamelContext: camel-1) is starting 2019-11-21 09:59:46.512 INFO 65135 --- [ main] o.a.c.management.JmxManagementStrategy : JMX is enabled 2019-11-21 09:59:46.702 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html 2019-11-21 09:59:46.740 INFO 65135 --- [ main] c.s.b.CamelSpringBootApplicationListener : Starting CamelMainRunController to ensure the main thread keeps running 2019-11-21 09:59:46.744 INFO 65135 --- [inRunController] org.apache.camel.main.BaseMainSupport : Using properties from classpath:application.properties 2019-11-21 09:59:46.912 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootCamelContext : Route: route1 started and consuming from: activemq://foo 2019-11-21 09:59:46.917 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootCamelContext : Route: route2 started and consuming from: timer://bar 2019-11-21 09:59:46.921 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootCamelContext : Total 2 routes, of which 2 are started 2019-11-21 09:59:46.922 INFO 65135 --- [inRunController] o.a.c.i.engine.DefaultShutdownStrategy : Starting to graceful shutdown 1 routes (timeout 300 seconds) 2019-11-21 09:59:46.924 INFO 65135 --- [ main] o.a.c.s.boot.SpringBootCamelContext : Apache Camel 3.0.0-SNAPSHOT (CamelContext: camel-1) started in 0.409 seconds 2019-11-21 09:59:46.928 INFO 65135 --- [ main] sample.camel.SampleAmqApplication : Started SampleAmqApplication in 1.554 seconds (JVM running for 1.854) 2019-11-21 09:59:47.932 INFO 65135 --- [ - ShutdownTask] o.a.c.i.engine.DefaultShutdownStrategy : Route: route1 shutdown complete, was consuming from: activemq://foo 2019-11-21 09:59:47.932 INFO 65135 --- [inRunController] o.a.c.i.engine.DefaultShutdownStrategy : Graceful shutdown of 1 routes completed in 1 seconds 2019-11-21 09:59:47.934 INFO 65135 --- [inRunController] o.a.c.s.boot.SpringBootCamelContext : Route: route1 is stopped, was consuming from: activemq://foo 2019-11-21 09:59:47.936 INFO 65135 --- [inRunController] o.a.c.s.boot.SpringBootCamelContext : Route: route1 is shutdown and removed, was consuming from: activemq://foo 2019-11-21 09:59:47.937 INFO 65135 --- [inRunController] o.a.c.i.engine.DefaultShutdownStrategy : Starting to graceful shutdown 1 routes (timeout 300 seconds) 2019-11-21 09:59:47.939 INFO 65135 --- [ - ShutdownTask] o.a.c.i.engine.DefaultShutdownStrategy : Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 300 seconds. Inflights per route: [route2 = 1] 2019-11-21 09:59:47.941 INFO 65135 --- [ - ShutdownTask] o.a.c.i.engine.DefaultShutdownStrategy : There are 1 inflight exchanges: InflightExchange: [exchangeId=ID-davsclaus-pro-local-1574326786736-0-1, fromRouteId=route2, atRouteId=route2, nodeId=to2, elapsed=12, duration=18] 2019-11-21 09:59:48.944 INFO 65135 --- [ - ShutdownTask] o.a.c.i.engine.DefaultShutdownStrategy : Route: route2 shutdown complete, was consuming from: timer://bar 2019-11-21 09:59:48.944 INFO 65135 --- [inRunController] o.a.c.i.engine.DefaultShutdownStrategy : Graceful shutdown of 1 routes completed in 1 seconds 2019-11-21 09:59:48.946 INFO 65135 --- [inRunController] o.a.c.s.boot.SpringBootCamelContext : Route: route2 is stopped, was consuming from: timer://bar 2019-11-21 09:59:48.947 INFO 65135 --- [inRunController] o.a.c.s.boot.SpringBootCamelContext : Route: route2 is shutdown and removed, was consuming from: timer://bar 2019-11-21 09:59:48.966 INFO 65135 --- [inRunController] o.a.c.s.boot.SpringBootCamelContext : Route: route1 started and consuming from: activemq://foo 2019-11-21 09:59:48.976 INFO 65135 --- [msConsumer[foo]] sample : Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello from Camel] 2019-11-21 09:59:48.978 INFO 65135 --- [inRunController] o.a.c.s.boot.SpringBootCamelContext : Route: route2 started and consuming from: timer://bar 2019-11-21 09:59:48.978 INFO 65135 --- [inRunController] o.a.camel.main.DefaultRoutesCollector : Loading additional Camel XML routes from: classpath:camel/*.xml 2019-11-21 09:59:48.979 INFO 65135 --- [inRunController] o.a.camel.main.DefaultRoutesCollector : Loading additional Camel XML rests from: classpath:camel-rest/*.xml -- This message was sent by Atlassian Jira (v8.3.4#803005)