Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
   from("direct:foo").filter().spel("#{request.headers['foo'] == 'bar'}").to("direct:bar");

Loading script from external resource

Available as of Camel 2.11

You can externalize the script and have Camel load it from a resource such as "classpath:", "file:", or "http:".
This is done using the following syntax: "resource:scheme:location", eg to refer to a file on the classpath you can do:

Code Block

.setHeader("myHeader").spel("resource:classpath:myspel.txt")

Dependencies

You need Spring 3.0 or higher to use Spring Expression Language. If you use Maven you could just add the following to your pom.xml:

...