...
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
@Component
public class MyRouter extends RouteBuilder {
@Override
public void configure() throws Exception {
from("jms:invoices").to("file:/invoices");
}
} |
...
language | java |
---|
...
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:
...