ChrisGeo ChrisGeo - 9 months ago 86
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?


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).