Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 51254 invoked from network); 12 Jun 2009 04:20:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 04:20:58 -0000 Received: (qmail 20139 invoked by uid 500); 12 Jun 2009 04:21:09 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 20061 invoked by uid 500); 12 Jun 2009 04:21:09 -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 20051 invoked by uid 99); 12 Jun 2009 04:21:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 04:21:09 +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: domain of claus.ibsen@gmail.com designates 209.85.218.226 as permitted sender) Received: from [209.85.218.226] (HELO mail-bw0-f226.google.com) (209.85.218.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 04:20:58 +0000 Received: by bwz26 with SMTP id 26so1760672bwz.20 for ; Thu, 11 Jun 2009 21:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=2Ii1l8geqFLjbltcBHd1FgOPzOtfUCdVciEMbAqbqr0=; b=VB5/DaWoZrMHky99z2oiLtxIb9K9oSVL0xqzhZsTc1Zl4no6QOtX5laetF4bVPBq/K 7mm6Kerqxd7hT1O9R7pt7sR8Ct/yRboxZ+RpDUR+Mgl0t52PpnIGLKN6DT1BijGi79PQ BwRpR8IIaIqSBEP1AECQBaEqXOp/+jA5fnMe0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=iW0m1jeWzBmsboTLkvJbrz3at+KqU34MjPhCZE4BNy01pbRfgK3+WwE22ZGmeBhoV4 N2no7MpVJV7AThTePl4jFSuaDkoZFi1cr46/lnpHYWa8Z2vn4TP/fxk51XU8t9LCGKn5 itrYzLVjJVJs+L8KsOOKC0BGAd6vgqKIqvfoE= MIME-Version: 1.0 Received: by 10.223.126.1 with SMTP id a1mr2482057fas.52.1244780436450; Thu, 11 Jun 2009 21:20:36 -0700 (PDT) In-Reply-To: <23987836.post@talk.nabble.com> References: <23970613.post@talk.nabble.com> <5380c69c0906102005m5bae4af4n66780a2971d08c01@mail.gmail.com> <23987836.post@talk.nabble.com> From: Claus Ibsen Date: Fri, 12 Jun 2009 06:20:14 +0200 Message-ID: <5380c69c0906112120q78191f32y11eee0203774e63@mail.gmail.com> Subject: Re: Autowiring RouteBuilders defined as beans in Spring. To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Jun 11, 2009 at 9:53 PM, sgargan wrote: > > Cheers Claus. The ant exclusions sound like a good idea. Let me take a lo= ok > at what that would involve. Cool we love contributions. Feel free to create a JIRA ticket for the idea and you could write a comment in there that you are looking into it. http://camel.apache.org/contributing.html > > thx for your help, > > ste > > > Claus Ibsen-2 wrote: >> >> On Wed, Jun 10, 2009 at 10:42 PM, sgargan wrote: >>> >>> In the 1.6 codeline it was possible to define routebuilders as beans in= a >>> Spring context and have them wired into the camel context upon >>> intialization >>> e.g. >>> >>> >>> >>> This bean would have been added to the context when the following block >>> of >>> code in in the =A0installRoutes method of the CamelContextFactoryBean w= as >>> executed >>> >>> =A0protected void installRoutes() throws Exception { >>> =A0 =A0 =A0 =A0if (autowireRouteBuilders !=3D null && >>> autowireRouteBuilders.booleanValue()) { >>> =A0 =A0 =A0 =A0 =A0 =A0Map builders =3D >>> getApplicationContext().getBeansOfType(RouteBuilder.class, true, true); >>> =A0 =A0 =A0 =A0 =A0 =A0if (builders !=3D null) { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (Object builder : builders.values())= { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0getContext().addRoutes((RouteBui= lder) builder); >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >>> =A0 =A0 =A0 =A0 =A0 =A0} >>> =A0 =A0 =A0 =A0} >>> >>> In the 2.0 codeline, this section has been removed (as part of a fix fo= r >>> the >>> following issue/feature http://bit.ly/n6ojs ) and the context defined >>> routes >>> do not get added. I was wondering what the reason was for dropping this= ? >>> Was >>> it considered harmful? >> You can use the in . >> >> Yes it was considered to magical. What if you have 2 camel contextes >> then they would both >> load up all the route builders they could find as spring beans. >> >> And for users coming in to maintain the code would not be able to figure >> out >> how the routes are kick started. >> >> Yet alone the could be a bit difficult to understand. >> That reminds me, maybe if it was named package-scan it would be easier >> to hint that. >> >> >>> >>> I know the package scan can be used to initialise RouteBuilders it find= s >>> in >>> packages, but it can be annoying to exclude routes from this mechanism, >>> for >>> instance where you have test RouteBuilders that happen to live in the >>> same >>> package in the test src tree, or where there are routes that complicate >>> testing with setup and noise. Also in situations where you configure th= e >>> RouteBean explicitly e.g. to inject values from properties files, it is >>> much >>> cleaner to define the routes as beans. >> >> I have been wondering if we should add ANT files matcher here as well, >> so you can >> specify includes/excludes as well. >> >>> >>> Short of adding my own CamelContextAwareBean to do the same, Is there a >>> different mechanism to do setup Routes this way? >> Yes the tag. >> >> >>> >>> Thanks in advance >>> >>> Stephen. >>> -- >>> View this message in context: >>> http://www.nabble.com/Autowiring-RouteBuilders-defined-as-beans-in-Spri= ng.-tp23970613p23970613.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- > View this message in context: http://www.nabble.com/Autowiring-RouteBuild= ers-defined-as-beans-in-Spring.-tp23970613p23987836.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus