users@jersey.java.net

Re: [Jersey] WCF to Jersey interop, compression

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 09 Jul 2009 10:27:44 -0400

Salut,

Paul Sandoz wrote:
> Hi Arman,
>
> I am cross posting to the Grizzly users list, as it might a config issue
> with the compression set up, or it might be that the compression set up
> is for transport encoding rather than content encoding.
>
> Jersey also has a content encoding filter:
>
>
> https://jersey.dev.java.net/nonav/apidocs/1.1.0-ea/jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.html
>
>
> Paul.
>
> On Jul 7, 2009, at 11:21 AM, Arman Djusupov wrote:
>
>> Hello,
>>
>> I am testing REST interop between WCF and Jersey + standalone Grizzly
>> server. Up to now everything works fine, except of compression which
>> for some reason is not being applied despite having enabled it.
>>
>> I have initialized the standalone Grizzly in the following manner:
>>
>> System.out.println("Starting grizzly...");
>> SelectorThread threadSelector = GrizzlyWebContainerFactory.create(
>> baseUri, initParams);
>> threadSelector.setCompression("on");
>> threadSelector.setCompressableMimeTypes("application/fastinfoset");
>> threadSelector.setCompressionMinSize(0);
>>
>> System.out.println(String.format(
>> "Jersey app started with WADL available at
>> %sapplication.wadl\n” + “Try out %shelloworld\nHit enter to stop
>> it...", baseUri, baseUri));
>> System.in.read();
>>
>> The client sends a request with the following header:
>>
>> GET /tickhistory/?count=1000 HTTP/1.1
>> VsDebuggerCausalityData:
>> uIDPo8NPV7XwO0VGi6Vqcn5L7qcAAAAAHgkpNDHfjEGQyOWxx+Y5qyGawiJz7CdKr295EfxJus8ACQAA
>>
>> Accept-Encoding: gzip,deflate
>> Accept: application/fastinfoset,application/xml; charset=utf-8
>> Content-Type: application/fastinfoset
>> Host: 192.168.1.22:9998
>>
>> Grizzly replies using "application/fastinfoset" as it should (I am
>> using Fast Infoset as message encoding) but it does not compress the
>> traffic:
>>
>> HTTP/1.1 200 OK
>> server: grizzly/1.7
>> Content-Type: application/fastinfoset
>> Date: Fri, 03 Jul 2009 15:05:37 GMT
>> Content-Length: 7961
>>
>> Do you have any idea how can I enable compression? Or is it not
>> supported yet?

Based on the code snipped above it should have worked. Do you think you
can share a test case? One thing you may want to try first is to update
Grizzly to 1.9.15b:

http://download.java.net/maven/2/com/sun/grizzly/grizzly-http-webserver/1.9.15b/

to see if this is fixed. If you can't share a test case publicly, send
to jfarcand at apache dot org.

Thanks

-- Jeanfrancois

>>
>> With best regards,
>> Arman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>