Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor wording updates, some formatting

...

Apache Camel ships a Spring Boot Starter 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 automatically.

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

 

Auto-configured Camel context

...

Code Block
languagejava
@Component
public class MyRouter extends RouteBuilder {

  @Override
  public void configure() throws Exception {
    from("{{route.from}}").to("{{route.to}}");
  }

}

...

Custom Camel context configuration

...