ChrisGeo ChrisGeo - 1 year ago 229
Groovy Question

Apache Camel - Groovy Scripting

I am trying to use a Groovy script in the Spring DSL as follows:

<from uri="file://{{my.path}}">
<groovy>properties.resolve '' == 'true'</groovy>
<to uri="file://{{}}"/>
<to uri="file://{{file.two}}"/>

However I am getting the following exception:

Exhausted after delivery attempt:
1 caught: groovy.lang.MissingMethodException:
No signature of method: java.util.LinkedHashMap.resolve()
is applicable for argument types:
(java.lang.Boolean) values: [false]

I have these dependencies in my pom.xml:


Based on
I should be able to use the
reference with a

Any idea what is wrong?

Answer Source

I faced same issue so posting solution for other people who will face it in future.

Despite of information in camel doc which says that script context is preconfigured with properties attribute of org.apache.camel.builder.script.PropertiesFunction type it is not happening. Properties attribute is resolved to exchange properties. Seems like it is Camel defect (using Camel 2.16.1).


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download