Search code examples
javaapache-cameljvm-arguments

Access JVM options in Camel Context


I have JVM option to define each envrionment. It is something like -Denv="development". How can I access this JVM option in camel context and decide my route based on the env value?


Solution

  • use the camel-properties component...

    PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
    
    from("direct:start").to("properties:{{cool.end}}");