You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by edhansen42 <ed...@vsp.com> on 2013/12/18 18:32:20 UTC
contextScan in CamelConfiguration
I would like to use the java equivalent of the <contextScan/> tag to have my
camel context discover my @Component annotated SpringRouteBuilder instances.
I am creating my camel context via Spring by extending the
CamelConfiguration class and annotating the class with @Configuration.
My question - what do I need to do in my CamelConfiguration class to scan
for the routes? I found one other post on the topic, but didn't quite
understand the response. Do I need to manually scan for the route classes
in the routes() method? Or is there a way to retrieve route classes
directly from Spring?
Thanks
--
View this message in context: http://camel.465427.n5.nabble.com/contextScan-in-CamelConfiguration-tp5745004.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: contextScan in CamelConfiguration
Posted by edhansen42 <ed...@vsp.com>.
Looks like this is all going to be solved in 2.13.
http://camel.apache.org/camel-2130-release.html
<http://camel.apache.org/camel-2130-release.html>
"Spring Java Config CamelConfiguration now automagically detects all
RouteBuilder instances registered in the Spring context if
CamelConfiguration#routes method is not overridden."
--
View this message in context: http://camel.465427.n5.nabble.com/contextScan-in-CamelConfiguration-tp5745004p5745018.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: contextScan in CamelConfiguration
Posted by edhansen42 <ed...@vsp.com>.
Thanks Richard - that's actually the route (no pun intended) that I was
heading down.
I just want to make sure I'm not missing something, because it sure looks
easy to do in XML.
--
View this message in context: http://camel.465427.n5.nabble.com/contextScan-in-CamelConfiguration-tp5745004p5745011.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: contextScan in CamelConfiguration
Posted by Richard Kettelerij <ri...@gmail.com>.
Interesting case. AFAIK there's currently no out-of-the-box solution in the
camel-spring-javaconfig component for this. It would be a nice contribution
though (http://camel.apache.org/contributing.html).
If you want to give it a shot your self I perhaps you can take a look at
using the Spring @ComponentScan annotation together with the
ContextScanRouteBuilderFinder in camel-spring?
On Wed, Dec 18, 2013 at 6:32 PM, edhansen42 <ed...@vsp.com> wrote:
> I would like to use the java equivalent of the <contextScan/> tag to have
> my
> camel context discover my @Component annotated SpringRouteBuilder
> instances.
>
> I am creating my camel context via Spring by extending the
> CamelConfiguration class and annotating the class with @Configuration.
>
> My question - what do I need to do in my CamelConfiguration class to scan
> for the routes? I found one other post on the topic, but didn't quite
> understand the response. Do I need to manually scan for the route classes
> in the routes() method? Or is there a way to retrieve route classes
> directly from Spring?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/contextScan-in-CamelConfiguration-tp5745004.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>