On Sun, Sep 27, 2009 at 8:24 PM, Roman Kalukiewicz <roman.kalukiew...@gmail.com> wrote: > You set the body to constant value, so you have constant value. Use EL > expression instead of constant one if you want it to be evaluated. > > In simple words put <el> where you have <constant> ;) >
The <el> requires that you have camel-juel.jar on the classpath. http://camel.apache.org/el.html You can also use the simpler language which is provided out of the box. http://camel.apache.org/simple.html Which supports such a simple use case you have by using a header in a string. For example just replace <constant> with <simple> Camel itself have integration to many languages which you can see here: http://camel.apache.org/languages.html > Roman > > 2009/9/27 titexe <abdellatifbouch...@eurofins.com>: >> >> Hello, >> >> I'm trying to develop a route camel who can: >> >> Retrieve a value from the header of a message >> and put this value in an SQL query. >> >> Below my configuration: >> >> <route> >> <from uri="activemq:topic:XML.OUT.qmirror" /> >> <setBody> >> <constant>UPDATE CAMEL SET B='${in.header.MessageId}' WHERE >> C=2</constant> >> </setBody> >> <to uri="jdbc:testdb" /> >> </route> >> >> When I tested this variable ${in.header.MessageId}, I retrieve its value, >> unlike when I put this variable in the SQL query. >> >> Otherwise, the SQL executes perfectly. >> >> Thank you in advance for helping me complete this route >> >> Best regards, >> >> titexe >> -- >> View this message in context: >> http://www.nabble.com/Route-Camel-%3A-Pass-variables-in-a-SQL-query-tp25635878p25635878.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus