You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by James Talbut <jt...@spudsoft.co.uk> on 2013/08/20 12:46:32 UTC
Async client using chunking despite setAllowChunking( false )
Hi,
Most of my web service servers are running .Net and it can't cope with chunked client requests.
I have, for a long time, used the following to disable chunking:
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout( 10000 );
httpClientPolicy.setAllowChunking( false );
httpClientPolicy.setReceiveTimeout( readTimeoutMs );
Client client = org.apache.cxf.frontend.ClientProxy.getClient( port );
HTTPConduit http = ( HTTPConduit ) client.getConduit();
http.setClient( httpClientPolicy );
I now have the need to have TCP KeepAlives, so I preceeded that code with:
Map< String, Object > requestContext = binder.getRequestContext();
requestContext.put( AsyncHTTPConduit.USE_ASYNC, Boolean.TRUE );
But now I'm finding that requests are sometimes being chunked.
This isn't happening very often, but it is happening consistently - i.e. all the calls I made during testing worked and I've gone live without any problems - now I'm
finding two requests (that get made every five minutes) fail every time (because they are chunked).
What steps do I have to take to guarantee that requests are not chunked?
This is using CXF 2.7.4.
Thanks.
Jim
Re: Async client using chunking despite setAllowChunking( false )
Posted by Daniel Kulp <dk...@apache.org>.
The fix was ported to the 2.7.x branch. I don't know if the nightly builds have succeeded or not since then (and Jenkins is currently down so I cannot check). The SNAPSHOT should have it, but I'm not 100% sure.
Dan
On Sep 2, 2013, at 5:59 AM, James Talbut <jt...@spudsoft.co.uk> wrote:
> On Wed, Aug 28, 2013 at 01:23:11PM -0400, Daniel Kulp wrote:
>>
>> On Aug 28, 2013, at 4:46 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
>>
>>> From my investigations there doesn't seem to be any way to prevent chunked requests when using the AsyncHTTPConduit.
>>> Is that really true? :(
>>
>> Apparently yes…. Testing a fix now.
>>
> Did that fix get checked in?
> Is it available in maven (2.7.7-SNAPSHOT?).
>
> Thanks.
>
> Jim
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Async client using chunking despite setAllowChunking( false )
Posted by James Talbut <jt...@spudsoft.co.uk>.
On Wed, Aug 28, 2013 at 01:23:11PM -0400, Daniel Kulp wrote:
>
> On Aug 28, 2013, at 4:46 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
>
> > From my investigations there doesn't seem to be any way to prevent chunked requests when using the AsyncHTTPConduit.
> > Is that really true? :(
>
> Apparently yes…. Testing a fix now.
>
Did that fix get checked in?
Is it available in maven (2.7.7-SNAPSHOT?).
Thanks.
Jim
Re: Async client using chunking despite setAllowChunking( false )
Posted by Daniel Kulp <dk...@apache.org>.
On Aug 28, 2013, at 4:46 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
> On 20/08/2013 11:46, James Talbut wrote:
>> Hi,
>>
>> Most of my web service servers are running .Net and it can't cope with chunked client requests.
>> I have, for a long time, used the following to disable chunking:
>> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
>> httpClientPolicy.setConnectionTimeout( 10000 );
>> httpClientPolicy.setAllowChunking( false );
>> httpClientPolicy.setReceiveTimeout( readTimeoutMs );
>> Client client = org.apache.cxf.frontend.ClientProxy.getClient( port );
>> HTTPConduit http = ( HTTPConduit ) client.getConduit();
>> http.setClient( httpClientPolicy );
>>
>> I now have the need to have TCP KeepAlives, so I preceeded that code with:
>> Map< String, Object > requestContext = binder.getRequestContext();
>> requestContext.put( AsyncHTTPConduit.USE_ASYNC, Boolean.TRUE );
>>
>> But now I'm finding that requests are sometimes being chunked.
>> This isn't happening very often, but it is happening consistently - i.e. all the calls I made during testing worked and I've gone live without any problems - now I'm
>> finding two requests (that get made every five minutes) fail every time (because they are chunked).
>>
>> What steps do I have to take to guarantee that requests are not chunked?
>>
>> This is using CXF 2.7.4.
>>
>> Thanks.
>>
>> Jim
> From my investigations there doesn't seem to be any way to prevent chunked requests when using the AsyncHTTPConduit.
> Is that really true? :(
Apparently yes…. Testing a fix now.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Async client using chunking despite setAllowChunking( false )
Posted by Jim Talbut <jt...@spudsoft.co.uk>.
On 20/08/2013 11:46, James Talbut wrote:
> Hi,
>
> Most of my web service servers are running .Net and it can't cope with chunked client requests.
> I have, for a long time, used the following to disable chunking:
> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
> httpClientPolicy.setConnectionTimeout( 10000 );
> httpClientPolicy.setAllowChunking( false );
> httpClientPolicy.setReceiveTimeout( readTimeoutMs );
>
> Client client = org.apache.cxf.frontend.ClientProxy.getClient( port );
> HTTPConduit http = ( HTTPConduit ) client.getConduit();
> http.setClient( httpClientPolicy );
>
> I now have the need to have TCP KeepAlives, so I preceeded that code with:
> Map< String, Object > requestContext = binder.getRequestContext();
> requestContext.put( AsyncHTTPConduit.USE_ASYNC, Boolean.TRUE );
>
> But now I'm finding that requests are sometimes being chunked.
> This isn't happening very often, but it is happening consistently - i.e. all the calls I made during testing worked and I've gone live without any problems - now I'm
> finding two requests (that get made every five minutes) fail every time (because they are chunked).
>
> What steps do I have to take to guarantee that requests are not chunked?
>
> This is using CXF 2.7.4.
>
> Thanks.
>
> Jim
From my investigations there doesn't seem to be any way to prevent
chunked requests when using the AsyncHTTPConduit.
Is that really true? :(
Jim