Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 52636 invoked from network); 8 Dec 2010 06:32:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Dec 2010 06:32:26 -0000 Received: (qmail 91188 invoked by uid 500); 8 Dec 2010 06:32:26 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 91012 invoked by uid 500); 8 Dec 2010 06:32:25 -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 91004 invoked by uid 99); 8 Dec 2010 06:32:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Dec 2010 06:32:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [218.240.155.146] (HELO tongtech.com) (218.240.155.146) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Dec 2010 06:32:17 +0000 Received: from IBM0618 (unknown [218.240.156.210]) by tongtech.com with CMailServer 5.3 SMTP; Wed, 08 Dec 2010 14:31:55 +0800 From: "ext2" To: References: <1291629495068-3293765.post@n5.nabble.com> Subject: How about to support dynamic configurations in camel? Date: Wed, 8 Dec 2010 14:31:53 +0800 Message-ID: <7316A40A811D405B81AB1FEC73476350@IBM0618> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 In-Reply-To: <1291629495068-3293765.post@n5.nabble.com> Thread-Index: AcuVLC5qS5YO7VbWTA2/jUHQLEMSZQBa5MVw Hi: Changing the configuration dynamically at runtime to adjust the behavior of application is a use-full feature for many application. Camel support some dynamic mechanism now, etc: dynamic-routing pattern; but I still encounter some limits while using camel. For = example: 1)how could I dynamic change the behavior of a user custom bean? 2)How = could I dynamic change the behavior of the from endpoint and camel's = processor? etc: a filter's condition , changing the transaction's default = time-out. 3)dynamic create a new endpoint is not always needed, when we = doesn=A1=AFt really need dynamic routing , but just change a special behavior of = endpoint at runtime: ex. change a waiting timeout when calling a webservice; For these requirements, we(camel) could resolve them by custom solution for each situation. But if camel support some common mechanism = to support this, things will be better; While we using osgi with Apache Karaf, a basic dynamic configuration mechanism is already in-place; That is: OSGI Configuration Admin = Service and configuration property file deploying (Apache Karaf support it to mapping hot deployed property files to osgi configurations). So I am wondering if camel support this , dynamic configuration will be simplified; Maybe the usage will looks like as following: 1) user could write a property file as configuration: key will be mapped to Camel component(even endpoint)'s and user bean's property = based on a simple rule=A1=A3the value will be mapping to the property's value;=20 I am not sure about the rule about how to mapp the key to property. So I using a simplified rule to illustrate my thought: property file's = key =3D bean-id + "." + property-name.(this rule has a limit that it cannot = mapping property to endpoint). 2) While starting camel, camel will register a listener service for the osgi dynamic configuration. At runtime , while the listener received dynamic changed configuration , it will mapping the value to camel component, endpoint, or user custom bean's property. 3) Endpoint, Bean(also Camel Component) must implements a dynamic-configurable interface to say "I can be configured dynamically". Actually, in my own application, I have extend such a feature based on spring(it somewhat like spring's property override ). But it's = limited, and can not configure endpoint dynamically; Also I must changed some = source code of camel component to support my requirement. As the dynamic configuration requirement is very important for my application, I think it maybe useful for the others. So I post it here; Finally, dynamic-configuration requirement is not limited in OSGI. In the other situation, people should extend their own dynamic-configuration-detecting mechanism, and integrate it with camel; Thanks for any suggestion; Best Regards