On Tue, Feb 16, 2010 at 3:33 PM, Leen Toelen <[email protected]> wrote:
> 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.
>

Feel free to create a JIRA ticket.

However converting the body to a String is a safe way to ensure all
body is avail in memory. When working with streams oddities can happen
:)
But would be nice if jetty and file works nicely.

> Regards,
> Leen
>
> On Tue, Feb 16, 2010 at 2:45 PM, Claus Ibsen <[email protected]> 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 <[email protected]> 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
>>
>



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

Reply via email to