Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Available as of Camel 2.16
Using from Java DSL
The route below will read the file contents and validate them against a regular expression.
Using from Spring DSL
And from XML its easy as well
Mind that you can use CDATA in XML if the groovy scrip uses < > etc
Using external script files
You can refer to external script files instead of inlining the script. For example to load a groovy script from the classpath you need to prefix the value with resource: as shown:
You can also refer to the script from the file system with file: instead of classpath: such as file:/var/myscript.groovy