Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5C61A200C63 for ; Thu, 11 May 2017 14:44:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5B183160BC7; Thu, 11 May 2017 12:44:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9F58A160BB2 for ; Thu, 11 May 2017 14:44:23 +0200 (CEST) Received: (qmail 31237 invoked by uid 500); 11 May 2017 12:44:17 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 31226 invoked by uid 99); 11 May 2017 12:44:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2017 12:44:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 140AE188AA5 for ; Thu, 11 May 2017 12:44:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.416 X-Spam-Level: *** X-Spam-Status: No, score=3.416 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_ENVFROM_END_DIGIT=0.25, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_NEUTRAL=0.652, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id l-MBwNgemXRm for ; Thu, 11 May 2017 12:44:15 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A9D625F523 for ; Thu, 11 May 2017 12:44:14 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mwork.nabble.com (Postfix) with ESMTP id 11D4240C58E08 for ; Thu, 11 May 2017 05:44:14 -0700 (MST) Date: Thu, 11 May 2017 05:44:14 -0700 (MST) From: giannis_k To: users@camel.apache.org Message-ID: <1494506654062-5799304.post@n5.nabble.com> Subject: Camel spring boot destroys beans with wrong order. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Thu, 11 May 2017 12:44:24 -0000 Hello, I am using camel 2.18.2 with camel spring boot starter and spring versions: 1.4.1.RELEASE 4.3.3.RELEASE We consume messages from a kafka component and we shutdown the application, some beans are destroyed before the CamelContext causing messages to be lost because either e seda component does not exist or the connection to the database has been closed. Logs from an example: 15:40:48.966 [Thread-3] INFO o.s.c.a.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@4218d6a3: startup date [Wed May 10 15:40:30 EEST 2017]; root of context hierarchy 15:40:48.966 [Thread-4] INFO o.a.c.m.MainSupport$HangupInterceptor - Received hang up - stopping the main instance. 15:40:48.966 [Thread-4] INFO o.a.camel.spring.SpringCamelContext - Apache Camel 2.18.2 (CamelContext: camel) is shutting down 15:40:48.967 [Thread-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory' 15:40:48.967 [Thread-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactorySecondary' .... 15:40:48.968 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy method 'shutdown' on bean with name 'direct-component' 15:40:48.968 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy method 'shutdown' on bean with name 'seda-component' 15:40:48.973 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'mbeanExporter' 15:40:48.973 [Thread-3] INFO o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown 15:40:48.973 [Thread-4] INFO o.a.c.impl.DefaultShutdownStrategy - Starting to graceful shutdown 21 routes (timeout 300 seconds) 15:40:48.974 [Thread-3] INFO o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans 15:40:48.980 [Thread-3] DEBUG o.s.c.a.CommonAnnotationBeanPostProcessor - Invoking destroy method on bean 'applicationController': private void org.apache.camel.spring.boot.CamelSpringBootApplicationController.destroy() 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'consumerTemplate' 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'fluentTemplate' 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'template' 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean 'camel': [typeConverter, springTypeConverter, properties, org.apache.camel.component.kafka.KafkaComponent, constant-language, org.apache.camel.component.file.FileComponent, org.apache.camel.component.quartz2.QuartzComponent, org.apache.camel.component.zookeeper.ZooKeeperComponent, header-language] 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'camel' 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean 'ehcache': [cacheManager] 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Retrieved dependent beans for bean 'cacheManager': [org.springframework.cache.interceptor.CacheInterceptor#0] 15:40:48.980 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'ehcache' 15:40:48.980 [Thread-3] INFO o.s.c.e.EhCacheManagerFactoryBean - Shutting down EhCache CacheManager ... 15:40:49.017 [Thread-3] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy method 'close' on bean with name 'dataSourceSecondary' 15:40:49.017 [Thread-3] INFO com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Close initiated... org.apache.camel.component.seda.SedaConsumerNotAvailableException: No queue available on endpoint: seda://placed. at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:223) at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:169) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145) I can see a similar case in here however the workaround does not work for me. Is there a possible workaround for this issue? Thank you, Giannis -- View this message in context: http://camel.465427.n5.nabble.com/Camel-spring-boot-destroys-beans-with-wrong-order-tp5799304.html Sent from the Camel - Users mailing list archive at Nabble.com.