You need somehow to tell spring to shutdown those thread pools last, there is some way of defining bean ordering or depends-on in spring. Check the spring docs
On Wed, May 10, 2017 at 1:40 PM, Hetmoteus <hetmot...@gmail.com> wrote: > Hi, > > When I shutdown the application with at least 1 inflight exchange I get the > following logs : > > 2017-05-04 18:21:59.748 WARN 12188 --- [er[test.queue]] > o.a.activemq.jms.pool.PooledSession : Caught exception trying > rollback() when putting session back into the pool, will invalidate. > javax.jms.IllegalStateException: The Session is closed > > After some investigation via breakpoints. > On shutdown the ConnectionFactory.stop() method is called before the > CamelContext is shutdown. > > After more investigation, SpringCamelContext has a method called > "onApplicationEvent" which is handling the spring shutdown. But this method > is never called. > > Is that normal ? When I create a @Component which @Inject SpringCamelContext > and call it manually it works. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802p5799221.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