users@grizzly.java.net

Re: Force Chunking

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 23 Mar 2009 11:26:52 +0100

Salut,

Daniel Manzke wrote:
> Hi,
>
> is there a way to force Grizzly to use Chunking and to set the
> chunksize?

By default Grizzly use chunking all the time....but the API is not easy
to reach. Can you file an RFE (hopefully that one I can help more than
the other issue you filled...apology for that one)?

Mainly, you can do it by:

SelectorThread.setMaxHttpHeaderSize(chunkSize);

The method's name is wrong, but in theory it set the value the buffer
Grizzly internally use for the chunk size. Now from you GrizzlyAdapter,
you can always do:

GrizzlyResponse.setChunkingDisable(true|false);

or just do YourGrizzlyAdapter.chunkingDisable=true|false

This is extremely ugly, but I can fix it if you are planning to use it :-)


Some time ago when I used Metro (JAX-WS) and MTOM for sending
> binary content with a web service, there was a flag/property to enable
> chunking. Paul Sandoz (Jersey) told me that this is a container feature,
> but I'm not really sure. :)

I'm not sure Jersey ever used chunking directly from Grizzly. Same for
Metro.

A+

-- Jeanfrancois


>
>
> I wish you a nice weekend, ;)
> Daniel
>
>