1
votes

I have been trying to migrate from Camel 2.x to 3.x and having some issues with Spring Boot integration.

With Camel 2.x, i managed to disable auto injection of RouteBuilder instances annotated with @Component but have the other benefits, camel-spring provides. I do that since i have a prototype bean that extends from RouteBuilder and i manually add them to camel context as required.

With Camel 3.x, i can't do that. I can't remove @Component annotation from the class since i need Spring to inject other dependencies to class. Is there a way do that with Camel 3.x?

2
It seems you need to disable auto-registration of routes. I have edited question title to reflect that.Bedla

2 Answers

1
votes

Auto-discovery and registration of RouteBuilder instances to CamelContext can be disabled with property camel.springboot.routes-collector-enabled=false.

See Camel Spring Boot docs:

camel.springboot.routes-collector-enabled

Whether the routes collector is enabled or not. When enabled Camel will auto-discover routes (RouteBuilder instances from the registry and also load additional XML routes from the file system. The routes collector is default enabled.

0
votes

To disable Camel auto configuration (for example in tests)

@EnableAutoConfiguration(exclude = CamelAutoConfiguration.class)