Camel + SpringBoot: How to use custom properties in routes

Spring and Camel makes this quite easy (same solution can be used in Camel-K too). Here is an example of the use of custom property in a route

appilcation.properties

# Greeting
greeting = Hello World

# Timer
timer.period = 2000

Example route with the above properties

from("timer:hello?period={{timer.period}}")
     .log("{{greeting}}");

The route will now print out “Hello World” every 2 seconds

Tested on Apache Camel 3.20.0, SpringBoot 2.7.6, Java 11.0.18 and Ubuntu 20.04.4 LTS

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.