The hello of Camel in one file: a timer fires every second and a log line prints the greeting from application.properties.
INFO ... timer-log.camel.yaml:13 : Hello Camel! INFO ... timer-log.camel.yaml:13 : Hello Camel! INFO ... timer-log.camel.yaml:13 : Hello Camel!
Install JBang and the Camel CLI as described in the root README; camel --version confirms the install.
camel run *
Stop it with ctrl + c, or from another terminal with camel stop timer-log.
timer-log.camel.yaml is the route: from a timer that fires every timer.period milliseconds, a setBody puts the greeting in the message, and a log prints the body.application.properties holds the period and the greeting. {{timer.period}} and {{greeting.message}} in the route are property placeholders, resolved when the route starts..camel.yaml, the properties because of their name.Ask your assistant, or type it yourself, one step at a time, and run after each:
application.properties and set the body from the property.timer.period=5000 for a greeting every five seconds; the route file does not change.repeatCount: 3 to the timer parameters and the timer stops after three greetings.${date:now:HH:mm:ss} ${body} to see when each line was written.The example comes with a test in the Citrus YAML DSL, test/timer-log.citrus.it.yaml, which the Camel CLI runs:
camel test run test/timer-log.citrus.it.yaml
The test starts the route and verifies the logged greeting.
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!