users@jersey.java.net

WCF to Jersey interop, compression

From: Arman Djusupov <arman_at_noemax.com>
Date: Tue, 07 Jul 2009 12:21:09 +0300

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?

With best regards,
Arman