Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC78510612 for ; Thu, 26 Mar 2015 07:40:58 +0000 (UTC) Received: (qmail 20829 invoked by uid 500); 26 Mar 2015 07:40:58 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 20781 invoked by uid 500); 26 Mar 2015 07:40:58 -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 20769 invoked by uid 99); 26 Mar 2015 07:40:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2015 07:40:58 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of atanas.shindov@gmail.com does not designate 162.253.133.43 as permitted sender) Received: from [162.253.133.43] (HELO mwork.nabble.com) (162.253.133.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2015 07:40:52 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 20BD118B3AB6 for ; Thu, 26 Mar 2015 00:40:50 -0700 (PDT) Date: Thu, 26 Mar 2015 00:40:32 -0700 (MST) From: Atanas Shindov To: users@camel.apache.org Message-ID: <1427355632510-5764796.post@n5.nabble.com> Subject: Route removal triggers endpoint shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello, I have a custom singleton endpoint which manages a resource used by all consumers created by this endpoint. I open and close the resource in the start() and stop() methods of the endpoint assuming that this way I would prevent illegal states, i.e. the resource is closed, but a consumer is still active and tries to read it. However, I found out that Camel shutdowns an endpoint when a route is removed which reads from the endpoint. This is a problem when there are more than one routes reading from this endpoint as it results in the following sequence: [routes 1 & 2 are consuming from endpoint X] 1. route 1 is removed - producer 1 is stopped. - consumer 1 is stopped. *2. endpoint X is stopped.* 3. route 2 is still active and consumer 2 tires to access the closed resource. A comment above the ServiceHelper.stopAndShutdownServices(route.getEndpoint()) invocation inside the org.apache.camel.impl.RouteService.doShutdown() method where the shutdown happens says: "// endpoints should only be stopped when Camel is shutting down // see more details in the warmUp method" However, this is not the case. Is this a bug or I'm missing something? -- View this message in context: http://camel.465427.n5.nabble.com/Route-removal-triggers-endpoint-shutdown-tp5764796.html Sent from the Camel - Users mailing list archive at Nabble.com.