Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

camel-spring-boot jar comes with the spring.factories file, so as soon as you add that dependency into your classpath, Spring Boot will automatically auto-configure the Camel for you.

Camel Spring Boot Starter

Available as of Camel 2.17

Apache Camel ships a Spring Boot Starer module that allows you to develop Spring Boot applications using starter's. There is a sample application in the source code also.

To use the starter add the following to your spring boot pom.xml file

Code Block
xml
xml
<dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-spring-boot-starter</artifactId>
 <version>2.17.0</version>
</dependency>

Then you can just add classes with your Camel routes such as

Code Block
package com.example;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class MyRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        from("timer:foo").to("log:bar");
    }
}

Then these routes will automatic be started.

You can customize the Camel application in the application.properties or application.yml file. 

 

Auto-configured Camel context

...