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/12 12:39:46 UTC

[jira] Updated: (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:all-tabpanel ]

Willem Jiang updated CAMEL-2475:
--------------------------------

         Priority: Major  (was: Minor)
    Fix Version/s: 2.3.0

> 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.