Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 35288 invoked from network); 17 Jun 2009 18:11:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jun 2009 18:11:16 -0000 Received: (qmail 12571 invoked by uid 500); 17 Jun 2009 17:58:24 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 7713 invoked by uid 500); 17 Jun 2009 17:57:43 -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 5569 invoked by uid 99); 17 Jun 2009 17:53:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 17:53:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 17:53:10 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MGzJZ-0000LF-CX for users@camel.apache.org; Wed, 17 Jun 2009 10:52:49 -0700 Message-ID: <24078757.post@talk.nabble.com> Date: Wed, 17 Jun 2009 10:52:49 -0700 (PDT) From: sgargan To: users@camel.apache.org Subject: Re: Autowiring RouteBuilders defined as beans in Spring. In-Reply-To: <5380c69c0906162116t5691115bn63f6eee3efa3867e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sgargan@qualcomm.com References: <23970613.post@talk.nabble.com> <5380c69c0906102005m5bae4af4n66780a2971d08c01@mail.gmail.com> <23987836.post@talk.nabble.com> <24027819.post@talk.nabble.com> <4A35B268.50607@gmail.com> <24062126.post@talk.nabble.com> <5380c69c0906162116t5691115bn63f6eee3efa3867e@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Claus, My username for the wiki is sgargan. Cheers, ste Claus Ibsen-2 wrote: > > On Tue, Jun 16, 2009 at 10:21 PM, sgargan wrote: > >> >> I've put together some documentation for the feature, its not much. Claus >> mentioned some kind of karma(?) to allow me to edit the confluence >> pages. >> If you'd prefer I can just mail it to one of you, though I don't mind >> adding >> it. Just state a preference. > > > Hi > > To get karma you need to create an account on the wiki pages. Just click > edit in the bottom of any of the camel > html wiki pages. Then state your username in a mail on this forum and I > will > be able to grant your edit rights (= karma). > > > >> >> >> Cheers >> >> ste >> >> willem.jiang wrote: >> > >> > Hi Stephen, >> > >> > Claus created a same requirement[1] as yours, but I like your scanner >> > with exclude and include option more :) >> > >> > Thanks for your contribution. >> > >> > [1]https://issues.apache.org/activemq/browse/CAMEL-1695 >> > >> > Willem >> > >> > sgargan wrote: >> >> Claus, >> >> >> >> I've made a patch to allow the Ant like inclusion and exclusion you >> >> suggested. I've opened an improvement Jira ticket for it with a patch >> >> https://issues.apache.org/activemq/browse/CAMEL-1708. >> >> >> >> Please shout if there is anything you'd like changed with it. >> >> >> >> thx >> >> >> >> ste >> >> >> >> >> >> sgargan wrote: >> >>> Cheers Claus. The ant exclusions sound like a good idea. Let me take >> a >> >>> look at what that would involve. >> >>> >> >>> 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 installRoutes method of the CamelContextFactoryBean >> >>>>> was >> >>>>> executed >> >>>>> >> >>>>> protected void installRoutes() throws Exception { >> >>>>> if (autowireRouteBuilders != null && >> >>>>> autowireRouteBuilders.booleanValue()) { >> >>>>> Map builders = >> >>>>> getApplicationContext().getBeansOfType(RouteBuilder.class, true, >> >>>>> true); >> >>>>> if (builders != null) { >> >>>>> for (Object builder : builders.values()) { >> >>>>> getContext().addRoutes((RouteBuilder) builder); >> >>>>> } >> >>>>> } >> >>>>> } >> >>>>> >> >>>>> In the 2.0 codeline, this section has been removed (as part of a >> fix >> >>>>> for >> >>>>> 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 >> >>>>> finds >> >>>>> 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 >> >>>>> the >> >>>>> 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-Spring.-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-RouteBuilders-defined-as-beans-in-Spring.-tp23970613p24062126.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-RouteBuilders-defined-as-beans-in-Spring.-tp23970613p24078757.html Sent from the Camel - Users mailing list archive at Nabble.com.