You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christopher Love <ch...@cnmconsulting.net> on 2012/09/27 18:01:09 UTC
Context Scan with @Configuration and camel-spring-javaconfig
Hi all
Quick question about moving from XML to javaconfig.
In the past I have used this:
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<contextScan />
</camelContext>
I see the single route example using SingleRouteCamelConfiguration and I
saw CamelConfiguration that comes in camel-spring-javaconfig.
How do I do a contextScan? I looked through the camel factory bean that is
used to do the work in the above XML, and got nervous about
moving completely out of XML. It appears that the three lines of XML above
does A LOT of config :)
Any examples of @Configuration with multiple routes and contextScan, or
should I stick with the XML?
Thanks
Chris
Re: Context Scan with @Configuration and
camel-spring-javaconfig
Posted by Willem jiang <wi...@gmail.com>.
Basically, you just need to find out the RouteBuilder classes as you want in Java when you extends the CamelConfiguration class, then you don't need to be bothered by any XML.
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Friday, September 28, 2012 at 12:01 AM, Christopher Love wrote:
> Hi all
>
> Quick question about moving from XML to javaconfig.
>
> In the past I have used this:
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
> <contextScan />
> </camelContext>
>
> I see the single route example using SingleRouteCamelConfiguration and I
> saw CamelConfiguration that comes in camel-spring-javaconfig.
>
> How do I do a contextScan? I looked through the camel factory bean that is
> used to do the work in the above XML, and got nervous about
> moving completely out of XML. It appears that the three lines of XML above
> does A LOT of config :)
>
> Any examples of @Configuration with multiple routes and contextScan, or
> should I stick with the XML?
>
> Thanks
>
> Chris