Hi
On 20/09/12 12:23, Muller, Anthony wrote:
->  If GZIP is acceptable then the simples option is to add
->  @org.apache.cxf.annotation.GZIP to a root resource class.

Just to be sure, in this case, after adding this annotation:
- all subresources class will be configured as well or I have to add this 
annotation too?

Having it at a root resource class level should do,

Alternatively, register org.apache.cxf.transport.common.gzip.GZIPFeature. Actually, it is not possible to register features with CXFNonSpingJaxrsServlet, so the same can be achieved by registering org.apache.cxf.transport.common.gzip.GZIPOutInterceptor (via jaxrs.outInterceptors parameter) and if needed - org.apache.cxf.transport.common.gzip.GZIPInInterceptor

- must I add a "application/x-gzip" MIME type on JAX-RS methods?

it depends on what the client expectations are, if clients do expect
"application/x-gzip" then you can add it to a root resource class level...

GZIPOutInterceptor will only set 'Content-Encoding' to "gzip" or "x-gzip"

Cheers, Sergey

Regards,
Anthony

-----Original Message-----
From: Muller, Anthony [mailto:[email protected]]
Sent: jeudi 20 septembre 2012 13:09
To: Sergey Beryozkin; [email protected]
Subject: RE: JAX-RS - ZIP compression ?

Thanks Sergey, I will look at this asap :)

Regards,
Anthony

PS: about this point, we choose to have an interceptor mechanism at application 
level to handle lock/unlock on resources when necessary. Thanks!

-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: mardi 18 septembre 2012 22:57
To: [email protected]
Cc: Muller, Anthony
Subject: Re: JAX-RS - ZIP compression ?

Hi Anthony
On 18/09/12 21:36, Muller, Anthony wrote:
Hello Sergey,

Is there an (easy) way to accept/activate ZIP compression of REST responses?

If GZIP is acceptable then the simples option is to add
@org.apache.cxf.annotation.GZIP to a root resource class.

We also have a utility for supporting Deflate [1] encoding which I guess
is somewhat different to GZIP:

http://docs.oracle.com/javase/7/docs/api/java/util/zip/Deflater.html

The actual utility is in the rs xml security module - but if it were of
interest then we'd make it available at the common rt/core level, let us
know...

Cheers, Sergey

Thanks,
Anthony


P.S By the way, recall our conversation about making sure that a custom
ResponseHandler is invoked even if the exception is thrown from the
server application code, I can't seem to find that thread, but the thing
which I forgot to mention last time was that providing a custom
ExceptionMapper for Throwable would guarantee a Response would be avail
for response filters no matter what

Reply via email to