You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chaituu <ya...@gmail.com> on 2015/03/18 16:14:47 UTC
prevent header duplication for csv file
headers are getting duplicated for every request.I needed to append values to
the existing file with header should display once at the top.
used @CsvRecord(separator = ",", crlf = "UNIX",generateHeaderColumns=true)
for csv component.
<camelContext xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<bindy type="Csv"
packages="org.camelcookbook.transformation.csv.model" id="csvReport"/>
</dataFormats>
<route>
<from uri="cxf:bean:orderEndpoint" />
<process ref="orderWebService" />
<wireTap uri="seda:generateCSV"/>
</route>
<route>
<from uri="seda:generateCSV"/>
<bean ref="generateCSV" method="transFormToOrderCSV"/>
<marshal ref="csvReport"/>
<to uri="file:target/messages?fileName=
${date:now:yyyyMMdd}/TEST_${date:now:yyyyMMdd}.csv&fileExist=Append"/>
</route>
--
View this message in context: http://camel.465427.n5.nabble.com/prevent-header-duplication-for-csv-file-tp5764353.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: prevent header duplication for csv file
Posted by yogu13 <yo...@gmail.com>.
Hi,
I think the behaviour is happening due to SEDA component which you have
configured as it decouples the message processing into separate threads and
hence every thread ends up writing the header.
try removing seda if the behavior is not needed.
Regards,
-Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/prevent-header-duplication-for-csv-file-tp5764353p5764390.html
Sent from the Camel - Users mailing list archive at Nabble.com.