users@jersey.java.net

Re: [Jersey] Compression inn Jersey

From: Lars Tackmann <lars_at_randompage.org>
Date: Thu, 17 Jul 2008 10:41:49 +0200

On Wed, Jul 16, 2008 at 9:53 PM, Grazi, Victor
<victor.grazi_at_credit-suisse.com> wrote:
> We would be interested in compressing post and put requests to our Jersey
> implementation, as well as for all response bodies.
>
> Some choices are:
> Google Protocol buffers
> (http://google-opensource.blogspot.com/2008/07/protocol-buffers-googles-data.html)
> (Looks intesting!)
>
> Zip or Gzip
> Other binary encoding - Hessian?
>
> Is there any support (currently or planned) for passing compressed formats
> to and from Jersey?

Google Protocol buffers/Hessian (x-application/hessian) are mediatypes
so you can simply write a Entity Providers
(see JSR 311 spec, chap 4) to support them. If you instead use a
common media type such as "application/xml" and
chose to compress it using say 7zip, then you need to handle its
decoding yourself, since entity providers are supposed
 to work on decoded entity bodies. This should preferably be doable in
portable way (as in defined in the spec) but I am
 not sure if this can be achieved with the current version.


-- 
Yours sincerely
Lars Tackmann