Hello everyone,
I encountered a problem. I would like to pass to setHeader a non-constant
expression, but I can't seem to manage to do it.
My *route* looks like that :
//My own function that works well
int monthId = getLastIdFromBasis();
//Transforming xml into database
from ("file:src/data/xmlTest")
.split(xpath("/numbers/month"))
.filter().xpath(xpathReq)
.setHeader("ca", xpath("/month/ca/text()"))
.setHeader("margin", xpath("/month/margin/text()"))
.setHeader("monthName", xpath("/month/@name"))
* //.setHeader("monthId").body()*
.setBody(simple("INSERT INTO month VALUES (4,
'${header.monthName}',
${header.ca}, ${header.margin}, 1);"))
.to("jdbc:dataSource?useHeadersAsParameters=true");
The line I can't seem to code is the one in bold. I'd like to give it the
monthId I get few lines above and give it as a parameter into the SQL
Request too. Do you have any idea how I could do that ?
--
View this message in context:
http://camel.465427.n5.nabble.com/Give-setHeader-a-non-constant-value-tp5753914.html
Sent from the Camel - Users mailing list archive at Nabble.com.