Re: [Jersey] WCF to Jersey interop, compression

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Jersey] WCF to Jersey interop, compression

Paul Sandoz
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?
>
> With best regards,
> Arman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Jersey] WCF to Jersey interop, compression

Jeanfrancois Arcand-2
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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Jersey] WCF to Jersey interop, compression

testn
In reply to this post by Paul Sandoz
Try setCompression("force") instead of setCompression("on") setCompression("on") doesn't quite work with dynamic content.
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?
>
> With best regards,
> Arman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@jersey.dev.java.net
> For additional commands, e-mail: users-help@jersey.dev.java.net
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@grizzly.dev.java.net
For additional commands, e-mail: users-help@grizzly.dev.java.net
Reply | Threaded
Open this post in threaded view
|

Re: [Jersey] WCF to Jersey interop, compression

Jeanfrancois Arcand-2


testn wrote:
> Try setCompression("force") instead of setCompression("on")
> setCompression("on") doesn't quite work with dynamic content.

You are right! I should have recalled based on your email this week. I
think I will reconsider your proposal :-) :-)

Thanks!

-- Jeanfrancois

>
> 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?
>>>
>>> With best regards,
>>> Arman
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]