You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Christian Ribeaud (JIRA)" <ji...@apache.org> on 2019/01/07 12:13:00 UTC

[jira] [Comment Edited] (CAMEL-13026) camel-csv - Header written out on each message when marshalling

    [ https://issues.apache.org/jira/browse/CAMEL-13026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16726832#comment-16726832 ] 

Christian Ribeaud edited comment on CAMEL-13026 at 1/7/19 12:12 PM:
--------------------------------------------------------------------

What you are describing is a workaround. I should basically have two {{CSVFormats}}, one for _empty_ file and one for _non-empty_ one.

When writing out a _huge_ *CSV* file, you do not want to keep the content in the memory. Instead, you prefer to append to an existing file. And because it is possible to specify a header in {{CSVFormat}}, I would expect {{CsvMarshaller}} being smart enough to be able to handle such case.

But, I see your point, maybe one DOES want to write out a new file for each message. And they all should contain the header.

However, instead of making my routing more complicate, how about being able to:
 # Extend {{CsvMarshaller}} to customize it to my needs? (currently not possible)
 # -Specify a message property to tackle my use case?-


was (Author: christianr):
What you are describing is a workaround. I should basically have two {{CSVFormats}}, one for _empty_ file and one for _non-empty_ one.

When writing out a _huge_ *CSV* file, you do not want to keep the content in the memory. Instead, you prefer to append to an existing file. And because it is possible to specify a header in {{CSVFormat}}, I would expect {{CsvMarshaller}} being smart enough to be able to handle such case.

But, I see your point, maybe one DOES want to write out a new file for each message. And they all should contain the header.

However, instead of making my routing more complicate, how about being able to:
# Extend {{CsvMarshaller}} to customize it to my needs? (currently not possible)
# Specify a message property to tackle my use case?



> camel-csv - Header written out on each message when marshalling
> ---------------------------------------------------------------
>
>                 Key: CAMEL-13026
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13026
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-csv
>            Reporter: Christian Ribeaud
>            Priority: Major
>
> When *CSV* marshalling, the header is written out on each message.
> Additionally, {{CsvMarshaller}} is so opaque, making it difficult for customization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)