Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Camel scripting problem

I have a very strange problem with Apache ActiveMQ with Camel - I tried the examples with javascript and groovy, but they both produce error "Failed to install route: Failed to create route... because of No language could be found for: groovy"

The groovy example I use is

<route>
    <from uri="queue:foo"/>
    <filter>
        <groovy>request.lineItems.any { i -> i.value > 100 }</groovy>
        <to uri="queue:bar"/>
    </filter>
</route>

The same issue goes for JavaScript. The only scripting that works is "Simple" - the internal Camel scripting language. Please give me advice how to fix this. I am using ActiveMQ 5.2.4 with the integrated Apache Camel 2.4.0.

like image 744
o15a3d4l11s2 Avatar asked Mar 10 '11 15:03

o15a3d4l11s2


2 Answers

Yeah you need to add the JARs from camel-script and the scripting language of choice, eg for groovy you need the groovy JAR. If you run AMQ you should drop them in the lib folder.

like image 142
Claus Ibsen Avatar answered Oct 27 '22 00:10

Claus Ibsen


Do you have a dependency on camel-script fulfilled?

For instance in maven this would be declared as:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-script</artifactId>
    <version>2.6.0</version>
</dependency>

In your <dependencies> declaration.

like image 26
whaley Avatar answered Oct 27 '22 00:10

whaley