camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leen Toelen <toe...@gmail.com>
Subject Re: HTTP to File cuts messages
Date Tue, 16 Feb 2010 14:33:13 GMT
Hi,

this works indeed, thanks a lot. Should I create  a bug report for
this or not, to me it seems non-obvious to add the convertBodyTo or
ending up with partial output.

Regards,
Leen

On Tue, Feb 16, 2010 at 2:45 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> Try using a <convertBodyTo type="java.lang.String"/> to force it to
> convert the stream to string before writing.
>
>
> On Tue, Feb 16, 2010 at 11:44 AM, Leen Toelen <toelen@gmail.com> wrote:
>> Hi,
>>
>> I have the follwoing route defined:
>>
>>                <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>
>>
>> Now when I send a file to this url (52K in general), the client gets a
>> 200 OK back, but only a part of the files is written to disk (always
>> in chunks of 1,2,4 or 8KB).
>>
>> If I replace it with a two phase route, the files are written completely.
>>
>>                <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>
>>
>> Does anyone see what I am doing wrong, I would like the 1 phase route.
>> I am using camel 2.1.0.
>>
>> Regards,
>> Leen Toelen
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Mime
View raw message