-
1. Re: Set Headers from SQL Result
davsclaus Mar 13, 2014 2:33 AM (in response to labo32)Ah put the log inside the <split>, eg so it becomes
<route>
<from uri="sql:SELECT name, value FROM configtable"/>
<split>
<simple>${body}</simple>
<setHeader headerName="${body[name]}">
<simple>${body[value]}</simple>
</setHeader>
<to uri="log:headerLog?showHeaders=true"/>
</split>
</route>
-
2. Re: Set Headers from SQL Result
labo32 Mar 13, 2014 7:46 AM (in response to davsclaus)But I like to set two or more header informations to use it in a freemarker template and therefore the header informations
must be available after the split.
-
3. Re: Set Headers from SQL Result
davsclaus Mar 13, 2014 12:47 PM (in response to labo32)Then you need to use an aggregation strategy on the splitter to merge the data in the message you want to have after the splitter.
A better solution is maybe to use a java bean to set the headers you need. Also headerName= is not dynamic.
-
4. Re: Set Headers from SQL Result
labo32 Mar 17, 2014 3:30 AM (in response to davsclaus)Thanks for your answer. I will use a bean to set all my headers.
Is there a reason why headerName= is not dynamic ?
If not - treat my example as a feature request ;-)