[
https://issues.apache.org/activemq/browse/CAMEL-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58407#action_58407
]
Willem Jiang commented on CAMEL-2475:
-------------------------------------
Hi Leen,
I just added [an unit test|http://svn.apache.org/viewvc?rev=926956&view=rev] to
reproduce the bug that you showed, it looks CAMEL-2551 already fix the issue
that you found.
So please try out the latest Camel 2.3.0 snapshot for it.
> HTTP (Stream) to File only writes part of InputStream to File
> -------------------------------------------------------------
>
> Key: CAMEL-2475
> URL: https://issues.apache.org/activemq/browse/CAMEL-2475
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 2.1.0
> Reporter: Leen Toelen
> Assignee: Willem Jiang
> Fix For: 2.3.0
>
>
> The follwoing route only writes part of the http input stream to the file
> output (always
> in chunks of 1,2,4 or 8KB).:
> <route id="RestToTempDir">
> <from uri="jetty:http://0.0.0.0:8162/muyrl" />
> <setHeader headerName="CamelFileExchangeFile">
> <header>message.id</header>
> </setHeader>
> <to
>
> uri="file://c:/temp/?fileName=${date:now:yyyyMMdd}/asm-${id}.xml" />
> <setBody>
> <header>CamelFileExchangeFile</header>
> </setBody>
> </route>
> There are workarounds, but I would change streams to always read until EOF
> (if possible)
> Possible workaround 1:
> <convertBodyTo type="java.lang.String"/> to force it to convert the stream to
> string before writing.
> Possible workaround 2 is to write to a queue first
> <route id="RestToTempDir">
> <from uri="jetty:http://0.0.0.0:8162/myurl" />
> <inOnly uri="activemq:topic=TempTopic" />
> <setBody>
> <header>message.id</header>
> </setBody>
> <setHeader headerName="CamelFileExchangeFile">
> <header>message.id</header>
> </setHeader>
> </route>
> <route id="TempAssemblyToTempArchiveDirectory">
> <from uri="activemq:topic:TempTopic" />
> <setHeader headerName="CamelFileExchangeFile">
> <header>message.id</header>
> </setHeader>
> <to
>
> uri="file://c:/xmlarchive_noxslt/?fileName=${date:now:yyyyMMdd}/asm-${id}.xml"/>
> </route>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.