camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bgoetzmann <>
Subject Camel and Groovy
Date Fri, 21 Sep 2007 14:38:22 GMT


In a test (that works), I can use the Groovy language in an Expression:

CamelContext camelContext = new DefaultCamelContext();
		final GroovyExpression gexpr = new GroovyExpression("
== 'test1.txt'");
		camelContext.addRoutes(new RouteBuilder() {

		    public void configure() {
		        .setBody(body().append(" traité !"))


In this test, where we poll a folder named test to detect files with name
begining with 'test', the Groovy expression is used to filter messages and
keep messages containing a File object (as body) with a name equals to
All is OK.

Groovy is powerful language! So, I suppose I can put a lot of Groovy code in
a String. Is a way to execute Groovy code taken from a file, for example to
manipulate the content of my XML file?

Thank you.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message