Versions Compared

Key

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

...

Code Block
xml
xml
    <from uri="direct:in"/>
    <setHeader headerName="firstName">
        <expression language="jaskel">user.firstName</expression>
    </setHeader>
    <to uri="seda:users"/>

You can also use predicates e.g. in a Filter:

Code Block
xml
xml

    <filter>
        <language language="beanshell">request.getHeaders().get("Foo").equals("Bar")</language>
        <to uri="direct:next" />
    </filter>

Some languages with DSL support include:

Language

DSL keyword

EL

el

Groovy

groovy

JavaScript

javaScript

JoSQL

sql

JXPath

jxpath

MVEL

mvel

OGNL

ognl

PHP

php

Python

python

Ruby

ruby

XPath

xpath

XQuery

xquery

Some languages without specific DSL support but known to work with these generic methods include:

Language

Implementation

language="..." value

BeanShell

BeanShell 2.0b5

beanshell or bsh

Dependencies

To use scripting languages in your camel routes you need to add the a dependency on camel-script which integrates the JSR-223 scripting engine.

...