Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE95610D1D for ; Sat, 1 Mar 2014 06:57:23 +0000 (UTC) Received: (qmail 67376 invoked by uid 500); 1 Mar 2014 06:57:22 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 67285 invoked by uid 500); 1 Mar 2014 06:57:20 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 67261 invoked by uid 99); 1 Mar 2014 06:57:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Mar 2014 06:57:19 +0000 Date: Sat, 1 Mar 2014 06:57:19 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-7259) ProducerTemplate is not aligned with the lifecycle of CamelContext and therefore it's possible to have a Producer that's never shutdown correctly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-7259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13916965#comment-13916965 ] Claus Ibsen commented on CAMEL-7259: ------------------------------------ If you want Camel to stop the template when you stop CamelContext, then use the addService API on CamelContext. > ProducerTemplate is not aligned with the lifecycle of CamelContext and therefore it's possible to have a Producer that's never shutdown correctly. > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: CAMEL-7259 > URL: https://issues.apache.org/jira/browse/CAMEL-7259 > Project: Camel > Issue Type: Improvement > Components: camel-core > Affects Versions: 2.12.3 > Reporter: Aaron Whiteside > Priority: Minor > Fix For: 2.13.0 > > > ProducerTemplate is not aligned with the lifecycle of CamelContext and therefore it's possible to have a Producer that's never shutdown correctly. > {code} > context.start(); > ProducerTemplate template = context.createProducerTemplate(); > template.sendBody("test://test", "Hello"); > context.stop(); > {code} > If I never call template.stop() the Producer for the test component (or indeed any other component in it's place) will never receive a call to doStop. But the Endpoint that the Producer is associated with will be stopped.. which is a weird situation/state to be in..? > context.stop() should cleanup any and all Producers, even those created by a ProducerTemplate.. after such time a ProducerTemplate should become invalid and perhaps throw an exception that the camel context has been shutdown? -- This message was sent by Atlassian JIRA (v6.1.5#6160)