Trying to use a Groovy script inside a Camel (version 12.2.1) validator I
encountered the problem that the validator returns always the result form
first evaluation (from first message) for subsequent messages. By looking
into the code (/org.apache.camel.builder.script.ScriptBuilder/) I noticed
that this is caused by calling /result = compiledScript.eval()/; in
/runScript/ method without passing as a parameter the recently updated
context (in /populateBindings /) and so the cached context from compilation
time(first execution) is always used.
A quick solution (for testing purpose) was to recompile the camel-scripting
component after changing the above mentioned call to /result =
compiledScript.eval(getScriptContext())/;



-----
Florin
--
View this message in context: 
http://camel.465427.n5.nabble.com/Groovy-compiled-scripts-cache-execution-context-tp5747131.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to