Thanks for the fast reply Sergey! But I am fine with setting the 
use.async.http.conduit property (your log line proved that :-) ) but the 
problem I have is with the keep alive settings below.. It doesn't look to me 
like they are getting set the the values I specify...

Sent from a mobile device

> On 15 Apr 2014, at 21:54, Sergey Beryozkin <[email protected]> wrote:
> 
> Hi Mandy
> 
> In my tests I do
> 
> WebClient.getConfig(myWebClient),getRequestContext().put("use.async.http.conduit",
>  true);
> 
> Setting the property on BusFactory.getThreadDefaultBus(true) shpuld also work
> HTH, Sergey
> 
> 
>> On 15/04/14 20:02, Mandy Warren wrote:
>> 
>> Hi,
>> 
>> I've knocked up a unit test to prove my settings for
>> org.apache.cxf.transport.http.async.MAX_PER_HOST_CONNECTIONS  and
>> org.apache.cxf.transport.http.async.MAX_CONNECTIONS are getting set
>> correctly but not having much luck!
>> 
>> Here's the test:-
>> 
>>    @Test
>>    public void getClientUsingApacheCommonsAsync() throws Exception {
>>            BusFactory.getDefaultBus().setProperty
>> ("use.async.http.conduit", true);
>>            BusFactory.getDefaultBus().setProperty
>> ("org.apache.cxf.transport.http.async.MAX_PER_HOST_CONNECTIONS", 10000);
>>            BusFactory.getDefaultBus().setProperty
>> ("org.apache.cxf.transport.http.async.MAX_CONNECTIONS", 10000);
>> 
>>            WebClient.create(adfmsDummyServer.getBaseURL(),
>>                    Lists.newArrayList(new JacksonJsonProvider()),
>> true).path("/delay").accept("application/json").get();
>>    // TODO - add some asserts, no idea what yet!
>>    }
>> 
>> I've grep'd the cxf source code and the only place I can see a ref to
>> either of the MAX_XXX properties is in AsyncHTTPConduitFactory. An instance
>> of this class is constructed when the bus is created and then the method
>> setProperties() is called passing in the bus properties to then set on the
>> connection:-
>> 
>>    public AsyncHTTPConduitFactory(Bus b) {
>>        this();
>>        addListener(b);
>>        config.setTcpNoDelay(true);
>>        setProperties(b.getProperties());
>>    }
>> 
>> BUT, when the bus is constructed and hence the AsyncHTTPConduitFactory
>> constructor is called, the bus has no properties hence the default values
>> of 5000 and 1000 are used. The setProperties() method is never called again
>> so I just can't work out how my actual properties get set on the
>> connection!
>> 
>> Any help much appreciated :-)
>> 
>> Many thanks
>> Mandy
>> 
>> Sent from a mobile device
> 
> 
> -- 
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/
> 
> Blog: http://sberyozkin.blogspot.com

Reply via email to