users@jersey.java.net

[Jersey] Re: Mule / Jersey Stream large file

From: Rajiv Jha <rajive.jha_at_gmail.com>
Date: Sat, 3 Nov 2012 00:43:27 -0600

I tried out with StreamingOutput , which worked well with smaller streams
but when I try with larger streams > 1.5 GB.
The calling program keeps on waiting for response even after stream is
prepared and on the serving side, the control simply does not return.

Can someone please post a working example utilizing StreamingOutput ? I
think I am doing something wrong on calling side.

Rajiv

On Sat, Nov 3, 2012 at 12:35 AM, Rajiv Jha <rajive.jha_at_gmail.com> wrote:

> Hi,
>
> I am using a flow which uses which inturn initializes a java<http://forum.mulesoft.org/mulesoft/topics/mule_jersey_stream_large_file#> class
> to do some processing and return back the results ( which is basically
> marshalled xml data as string ).
> This works fine in most of the cases but not where large file (around 2
> GB) is involved. It initially blew up while marshalling to string
> - I tried increasing heap size but it always blew up during marshalling of
> large data.
>
> So i decided to marshal data into a physical file with increased heap size
> in place. - This worked
>
> Now the next step was to return the file as result to calling program
> (which is on other server).
>
> I read and tried (multipart/mixed) and returning Stream of created file -
> this again has some problem and it really don't see any streaming
> happening.
>
> Question - I am curious to know how can I transfer my marshalled huge
> physical file to calling program in streamed/chunked way ?
>
> Consider file lying on mule server - can we achieve sending it to calling
> program through mule flows but not using any polling mechanism but on
> demand from calling program ? Or using Mule jersey itself if i need to do
> something else.
>
> Please post or direct me to a working example -
>
> Eagerly awaiting reply.
>
> Thanks in advance,
> Rajiv Jha<http://forum.mulesoft.org/mulesoft/topics/mule_jersey_stream_large_file#>
>