THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
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 | ||||
---|---|---|---|---|
| ||||
<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 | ||
---|---|---|
| ||
@Component public class MyRouter extends RouteBuilder { @Override public void configure() throws Exception { from("{{route.from}}").to("{{route.to}}"); } } |
...
Custom Camel context configuration
...