6.7. Camel Spring Boot auto configuration の Camel プロパティーの設定

Spring Boot auto-configuration は、プロパティーのプレースホルダー、OS 環境変数、Camel プロパティーがサポートされるシステムプロパティーなどの Spring Boot 外部設定に接続します。

手順

  1. application.properties ファイルにプロパティーを定義します。 

    route.from = jms:invoices

    または、以下の例のように Camel プロパティーをシステムプロパティーとして設定します。

    java -Droute.to=jms:processed.invoices -jar mySpringApp.jar
  2. 次のように、設定されたプロパティーを Camel ルートのプレースホルダーとして使用します。

    @Component
    public class MyRouter extends RouteBuilder {
    
      @Override
      public void configure() throws Exception {
        from("{{route.from}}").to("{{route.to}}");
      }
    
    }