You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2010/03/19 04:21:54 UTC
[jira] Commented: (CAMEL-2475) HTTP (Stream) to File only writes
part of InputStream to File
[ https://issues.apache.org/activemq/browse/CAMEL-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58323#action_58323 ]
Willem Jiang commented on CAMEL-2475:
-------------------------------------
Hi Leen,
Can you try out the latest Camel 2.3.0 snapshot to see if the bug still there?
As we just applied a patch of CAMEL-2551 into the Came trunk. I think it could also fix the issue that you meet.
> 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.