Package com.ning.http.client

Examples of com.ning.http.client.AsyncHttpClientConfig


public class AhcProduceClientConfigTest extends BaseAhcTest {

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
        AsyncHttpClientConfig config = builder.setFollowRedirects(true).setMaxRequestRetry(3).build();

        JndiRegistry jndi = super.createRegistry();
        jndi.bind("myConfig", config);
        return jndi;
    }
View Full Code Here


    Stats execute(final URI targetURI, byte[] content, int n, int c) throws Exception {
        if (this.client != null) {
            this.client.close();
        }
        AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
            .setKeepAlive(true)
            .setCompressionEnabled(false)
            .setMaximumConnectionsPerHost(c)
            .setMaximumConnectionsTotal(2000)
            .setRequestTimeoutInMs(15000)
View Full Code Here

        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 ) //
                .setConnectionTimeoutInMs( cubeBuilder.getConnectionTimeout() ) //
                .setRequestTimeoutInMs( cubeBuilder.getPostTimeout() ) //
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        if (client == null) {
           
            AsyncHttpClientConfig config = null;
           
            if (clientConfig != null) {
                AsyncHttpClientConfig.Builder builder = AhcComponent.cloneConfig(clientConfig);
               
                if (sslContextParameters != null) {
View Full Code Here

public class AhcProduceClientConfigTest extends BaseAhcTest {

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
        AsyncHttpClientConfig config = builder.setFollowRedirects(true).setMaxRequestRetry(3).build();

        JndiRegistry jndi = super.createRegistry();
        jndi.bind("myConfig", config);
        return jndi;
    }
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        if (client == null) {
           
            AsyncHttpClientConfig config = null;
           
            if (clientConfig != null) {
                AsyncHttpClientConfig.Builder builder = AhcComponent.cloneConfig(clientConfig);
               
                if (sslContextParameters != null) {
View Full Code Here

    }

    protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException, GeneralSecurityException {

        AsyncHttpClient c;
        AsyncHttpClientConfig config;

        AsyncHttpClientConfig.Builder builder =
                new AsyncHttpClientConfig.Builder();

        builder.setSSLContext(new SSLContextParameters().createSSLContext());
View Full Code Here

    }

    protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException, GeneralSecurityException {

        AsyncHttpClient c;
        AsyncHttpClientConfig config;

        AsyncHttpClientConfig.Builder builder =
                new AsyncHttpClientConfig.Builder();

        builder.setSSLContext(new SSLContextParameters().createSSLContext());
View Full Code Here

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

        AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
        AsyncHttpClientConfig config = builder.setFollowRedirects(true).setMaxRequestRetry(3).build();

        AhcComponent ahc = context.getComponent("ahc", AhcComponent.class);
        ahc.setClientConfig(config);

        return context;
View Full Code Here

        // 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)
                .build();
View Full Code Here

TOP

Related Classes of com.ning.http.client.AsyncHttpClientConfig

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.