You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marcin Zajączkowski <ms...@wp.pl> on 2016/02/21 02:13:38 UTC

equivalent in Spring JavaConfig

Hi,

Recently I was migrating Camel configuration in one of my Spring-based
projects from XML to JavaConfig. The part that took me a while was the
ability to add routes. I was creating Spring bean(s) of RouteBuilder
with the route(s) defined. Unfortunately they were not discovered by
Camel and not used. I ended up with manual
`camelContext.addRoutes(routeBuilder)`, but with <contextScan/> defined
in XML my JavaConfig beans are still found automatically. Unfortunately
I wasn't able to find a counterpart in JavaConfig. I've read that Spring
Boot auto configuration for Camel handles that, but my application uses
pure Spring only.

My question: How to enable context scan for RouteBuilder beans in (pure)
Spring context using Java Config only (no XML)?

Marcin

-- 
http://blog.solidsoft.info/ - Working code is not enough

Re: equivalent in Spring JavaConfig

Posted by Marcin Zajączkowski <ms...@wp.pl>.
On 2016-02-21 02:13, Marcin Zajączkowski wrote:
> Hi,
> 
> Recently I was migrating Camel configuration in one of my Spring-based
> projects from XML to JavaConfig. The part that took me a while was the
> ability to add routes. I was creating Spring bean(s) of RouteBuilder
> with the route(s) defined. Unfortunately they were not discovered by
> Camel and not used. I ended up with manual
> `camelContext.addRoutes(routeBuilder)`, but with <contextScan/> defined
> in XML my JavaConfig beans are still found automatically. Unfortunately
> I wasn't able to find a counterpart in JavaConfig. I've read that Spring
> Boot auto configuration for Camel handles that, but my application uses
> pure Spring only.
> 
> My question: How to enable context scan for RouteBuilder beans in (pure)
> Spring context using Java Config only (no XML)?

As it seems to be unavailable I created a feature request:
https://issues.apache.org/jira/browse/CAMEL-9650

Marcin

-- 
http://blog.solidsoft.info/ - Working code is not enough