You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nishtha Rai (Jira)" <ji...@apache.org> on 2021/03/10 09:26:00 UTC

[jira] [Commented] (CAMEL-16325) CamelFileNameProduced header not coming when there is no data in the file

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

Nishtha Rai commented on CAMEL-16325:
-------------------------------------

[~davsclaus] Could you please share details of mailing list or any link for chat room

> CamelFileNameProduced header not coming when there is no data in the file
> -------------------------------------------------------------------------
>
>                 Key: CAMEL-16325
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16325
>             Project: Camel
>          Issue Type: Bug
>          Components: came-core
>            Reporter: Nishtha Rai
>            Priority: Major
>
> Hi,
> We have created a simple camel route -
> @Override@Override public void configure() throws Exception \{ from("file://C:/in/?fileName=Input_UTF8.txt") .process(exchange -> {           System.out.println("Headers after in: "+ exchange.getIn().getHeaders());     })         .onCompletion()           .process(exchange -> \{                 sendFooter(exchange);                 System.out.println("Headers after Footer: "+ exchange.getIn().getHeaders());           })                   .end()                      .process(exchange -> \{  sendHeader(exchange);  System.out.println("Headers after header: "+ exchange.getIn().getHeaders());        }) .split(body().tokenize(lineSeperator)) .streaming()   .to("file://C:/out/?fileName=Output.txt&fileExist=Append") .process(exchange -> \{           System.out.println("Headers after each record: "+ exchange.getIn().getHeaders());     }); } private void sendHeader(Exchange exchange) \{ ProducerTemplate template = getContext().createProducerTemplate(); template.sendBodyAndHeaders("file://C:/out/?fileName=Output.txt&fileExist=Append","header1,header2",exchange.getIn().getHeaders());    } private void sendFooter(Exchange exchange) \{ ProducerTemplate template = getContext().createProducerTemplate();               template.sendBodyAndHeaders("file://C:/out/?fileName=Output.txt&fileExist=Append","footer",exchange.getIn().getHeaders()); }
>  
> CamelFileNameProduced header is not coming when there is no data in the file (header and footer will be there) although it is creating a file in the destination directory.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)