Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 10132 invoked from network); 6 Dec 2008 13:26:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Dec 2008 13:26:27 -0000 Received: (qmail 29749 invoked by uid 500); 6 Dec 2008 13:26:40 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 29733 invoked by uid 500); 6 Dec 2008 13:26:40 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 29722 invoked by uid 99); 6 Dec 2008 13:26:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Dec 2008 05:26:40 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 74.125.92.146 as permitted sender) Received: from [74.125.92.146] (HELO qw-out-1920.google.com) (74.125.92.146) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Dec 2008 13:25:09 +0000 Received: by qw-out-1920.google.com with SMTP id 9so109946qwj.26 for ; Sat, 06 Dec 2008 05:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=m2JdGuLAbPWz8lTkm2SUJ5ZjrLT8i0jMyCcqG1TlCvQ=; b=bi00j254b0xhjPTptyE9eY6aGgCq7pOOlXDuY1pPdtJYWCmdndjjObWg8vDoUxKxR2 ZCmf3NJC6a1aGKjAcp77Rspmc2ot68YK9rUqHNfJPyPQsqF+Xmm4CMPOe4GjZTtEUuyC Cry3MWRlvGqWQFFd/4FR6fRS85zN3YO6PyRy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ZK2o2zm3qDdPqjdRzQdE70J2OceExVyCV7NqneKqXMqroEBRrg23YsIZ9cF8qrBK1J Z8ce2u0oAXhZxXzfH4aROahaZsAluT5AM6FDHg+AakDAPlVPrzD/n5XdcT8JqUrOUOPJ d2zzXjp0cUcnAB4+Q9o1RimEVQ86MUJjIM/SQ= Received: by 10.214.244.4 with SMTP id r4mr1117450qah.53.1228569957118; Sat, 06 Dec 2008 05:25:57 -0800 (PST) Received: by 10.214.9.14 with HTTP; Sat, 6 Dec 2008 05:25:57 -0800 (PST) Message-ID: <5380c69c0812060525l7809fe8bicdbcf64eb652ed69@mail.gmail.com> Date: Sat, 6 Dec 2008 14:25:57 +0100 From: "Claus Ibsen" To: camel-dev@activemq.apache.org Subject: Re: [PROPOSAL] - Camel 2.0 - support # syntax in URI options In-Reply-To: <509899e80812060518v4b99773bq23981537964b9fff@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5380c69c0812060508qc9988afy444ee299b12a2b36@mail.gmail.com> <509899e80812060518v4b99773bq23981537964b9fff@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Dec 6, 2008 at 2:18 PM, Ramon Buckland wrote: > +1 I like it. > > Would a feature such as auto-wiring be of any use also ? > so .. uri="foo:something?autowire=byname" > > This way, any bean available it the context is then auto-wired in ? Good idea. But is this autowire used much in pure spring? Personally I have always used explicit wiring. > > one other point, if #beanName is to be used, make sure the fallback of > attempting to set the String '#someString' still works as it would be > iritating if a #someString is needed but can't be because it is reserved for > bean wiring. Good catch. So if there is a String setter and NO bean in registry it should fallback to set the string? We do have options that support multiple types such as an expression that can be string based and thus there is a setter that accepts a String. But we have overloaded the option with Expresison type as well. So we should be lenient on the String settable options ;) > > r. > > On Sun, Dec 7, 2008 at 00:08, Claus Ibsen wrote: > >> Hi >> >> For background see CAMEL-895 and this thread by James >> >> http://www.nabble.com/-2.0--simplifying-annotations%2C-DSL-and-XML-to-remove-uri-%2B-ref--tp20775864s22882p20775864.html >> >> Motivation >> ======= >> Currently the URI configuration of camel endpoints is used a lot. It's >> fast, precise and intuitive for end-users. And it supports most of >> their use-cases. >> The URI options is given as string parameters just like http. Camel >> will then parse this and type convert and call the correct setter on >> the concrete xxxEndpoint object. >> Camel can do the traditional type converts for numeric, boolean, >> string, enum and what not. However the problem is... >> >> The problem >> ========= >> That we can not set complex objects on endpoint using URI options. >> Each individual component need to add special code to support this and >> it's irritating me. Why can't we do it smarter. >> And if we do it smarter then we get this out-of-the-box so suddenly >> *all* components support this. >> >> The idea >> ====== >> The idea is to support the # syntax for URI options (I think Apache >> CXF has this as well). >> >> So if you want to set a complex object type on a given endpoint you >> can refer to a bean in the registry using the # notation. An example: >> file://inbox/?idempotent=true&idempotentRepository=#myJpaRepo >> >> Then end users can configure the myJapRepo in the Spring XML using >> standard spring bean ids. >> >> Benefits >> ====== >> - It's easy for end users as they can look at the xxEndpoint and see >> which properties it has (setters). And they can use the # notation to >> set it for complex objects as well. >> - When you add options to an endpoint you get this notation for free, >> no need to add special code to the xxxComponent to do the lookup >> yourself >> - Even some options on default endpoints is now exposed and >> configurable, such as the executorService >> - We can reduce existing code >> - Easier for end users to understand that # is for regestry lookup >> instead of inventing our own custom names such as: >> idempotentRepositoryRef >> - And as a real bonus we don't have to wiki document the special >> options idempotentRepositoryRef. We get all this for free with # so we >> can just document the idempotentRepository option >> >> Any thoughts? >> >> >> /Claus Ibsen >> Apache Camel Committer >> Blog: http://davsclaus.blogspot.com/ >> >