Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [Spring Boot] Added placeholder information

...

Code Block
languagejava
@Configuration
public class MyRouterConfiguration {

  @Bean
  RoutesBuilder myRouter() {
    return new RouteBuilder() {


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

  };
}

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:  

Code Block
xml
xml
route.from = jms:invoices

...or set via system property...

Code Block
xml
xml
java -Droute.to=jms:processed.invoices -jar mySpringApp.jar

...can be used as placeholders in Camel route:

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

...