Package com.ning.http.client.providers.netty

Examples of com.ning.http.client.providers.netty.NettyAsyncHttpProviderConfig


        for (int r = 0; r < run; r++) {

            AsyncHttpClientConfig.Builder b = new AsyncHttpClientConfig.Builder();
            b.setFollowRedirect(true).setConnectionTimeout(-1).setReadTimeout(-1).setUserAgent("loader/1.1");

            NettyAsyncHttpProviderConfig nettyConfig = new NettyAsyncHttpProviderConfig();

            nettyConfig.addProperty("child.tcpNoDelay", "true");
            nettyConfig.addProperty("child.keepAlive", "true");

            final AsyncHttpClient c = new AsyncHttpClient(b.setAsyncHttpClientProviderConfig(nettyConfig).build());
            Client client = ClientFactory.getDefault().newClient();
            RequestBuilder request = client.newRequestBuilder();
            request.method(Request.METHOD.GET).uri(url);
View Full Code Here


*/
public class ClientUtil {
    private static final String WASYNC_USER_AGENT = "wAsync/2.0";

    public final static AsyncHttpClient createDefaultAsyncHttpClient(Options o) {
      NettyAsyncHttpProviderConfig nettyConfig = new NettyAsyncHttpProviderConfig();
        nettyConfig.addProperty("child.tcpNoDelay", "true");
        nettyConfig.addProperty("child.keepAlive", "true");
        return createDefaultAsyncHttpClient(o.requestTimeoutInSeconds(), nettyConfig)
    }
View Full Code Here

    public AsyncHttpClientCube( CubeBuilder cubeBuilder )
    {
        super( cubeBuilder );

        NettyAsyncHttpProviderConfig conf = new NettyAsyncHttpProviderConfig();
        conf.addProperty( NettyAsyncHttpProviderConfig.BOSS_EXECUTOR_SERVICE, Executors.newSingleThreadExecutor() );

        AsyncHttpClientConfig asyncHttpClientConfig =
            new AsyncHttpClientConfig.Builder().setAsyncHttpClientProviderConfig( conf ) //
                .setAllowPoolingConnection( true ) //
                .setAllowSslConnectionPool( true ) //
View Full Code Here

    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext context = super.createCamelContext();

        // use netty provider to reuse address
        NettyAsyncHttpProviderConfig provider = new NettyAsyncHttpProviderConfig();
        provider.addProperty(NettyAsyncHttpProviderConfig.REUSE_ADDRESS, Boolean.TRUE);

        AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
                .setAsyncHttpClientProviderConfig(provider)
                .setFollowRedirects(true)
                .setMaxRequestRetry(3)
View Full Code Here

TOP

Related Classes of com.ning.http.client.providers.netty.NettyAsyncHttpProviderConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.