Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Kura router OSGi info.

...

The easiest way to deploy Apache Camel routes into the Kura is to create an OSGi bundle containing the class extending org.apache.camel.compKuraRouter kura.KuraRouter class:

Code Block
languagejava
public class MyKuraRouter extends KuraRouter {

    @Override
    public void configure() throws Exception {
        from("timer:trigger").
          to("netty-http:http://app.mydatacenter.com/api");
    }

}

Auto-detecting Camel routes

Camel auto-configuration collects all the RoutesBuilder instances from the Spring context and automatically injects them into the provided Kura router starts its own OSGi-aware CamelContext. It means that creating new Camel route with the Spring Boot starter is as simple as adding the @Component annotated class into your classpath:

Code Block
languagejava
@Component
public class MyRouter extends RouteBuilder {

  @Override
  public void configure() throws Exception {
    from("jms:invoices").to("file:/invoices");
  }

}

...

languagejava

...

for every class extending KuraRouter, there will be a dedicated CamelContext instance. Ideally we recommend to deploy one KuraRouter per OSGi bundle.

Camel properties

Spring Boot auto-configuration automatically connect Spring Boot external configuration (like properties placeholders, OS environment variables or system properties) with the Camel properties support. It basically means that any property defined in application.properties file:  

...