You could use setHeader with xpath, like:
<camel:setHeader headerName="element1">
<camel:xpath>//Element1</camel:xpath>
</camel:setHeader>
and then, use these headers in you sql: statement.
to read the message id you can do as described in [1] with ${id}
[1] http://camel.apache.org/simple.html - Simple Expression Language
att.
*Henrique Viecili*
On Tue, Dec 18, 2012 at 2:09 PM, sprabu <[email protected]> wrote:
> Hi,
> I'm getting messages from route and want to insert xml payload values in
> sql.
> <from uri=queue:com.test.Queue1>
> <to uri="sql:insert into MY_TABLE
> values(${in.header.MessageId},//Element1,//Element2)" />
> ....
>
> Also i want to pass the jms message id to the sql query.
> How do i read the xml element values from the xml payload and have to pass
> those values to sql query?
> This should be done in the spring xml dsl.
>
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-do-i-read-the-xml-element-values-from-the-xml-payload-and-have-to-pass-those-values-to-sql-query-tp5724291.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>