camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin ZajÄ…czkowski <msz...@wp.pl>
Subject <contextScan/> equivalent in Spring JavaConfig
Date Sun, 21 Feb 2016 01:13:38 GMT
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

Mime
View raw message