protected NHttpClientConnectionManager getAsyncConnectionManager() {
        PoolingNHttpClientConnectionManager retval;

        IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
                .setConnectTimeout(httpClientConfig.getConnTimeout())
                .setSoTimeout(httpClientConfig.getReadTimeout())
                .build();

        Registry<SchemeIOSessionStrategy> sessionStrategyRegistry = RegistryBuilder.<SchemeIOSessionStrategy>create()
                .register("http", httpClientConfig.getHttpIOSessionStrategy())
                .register("https", httpClientConfig.getHttpsIOSessionStrategy())
                .build();

        try {
            retval = new PoolingNHttpClientConnectionManager(
                    new DefaultConnectingIOReactor(ioReactorConfig),
                    sessionStrategyRegistry
            );
        } catch (IOReactorException e) {
            throw new IllegalStateException(e);
        }

        final Integer maxTotal = httpClientConfig.getMaxTotalConnection();
        if (maxTotal != null) {
            retval.setMaxTotal(maxTotal);
        }
        final Integer defaultMaxPerRoute = httpClientConfig.getDefaultMaxTotalConnectionPerRoute();
        if (defaultMaxPerRoute != null) {
            retval.setDefaultMaxPerRoute(defaultMaxPerRoute);
        }
        final Map<HttpRoute, Integer> maxPerRoute = httpClientConfig.getMaxTotalConnectionPerRoute();
        for (Map.Entry<HttpRoute, Integer> entry : maxPerRoute.entrySet()) {
            retval.setMaxPerRoute(entry.getKey(), entry.getValue());
        }

        return retval;
    }
protected NHttpClientConnectionManager getAsyncConnectionManager ( ) { PoolingNHttpClientConnectionManager retval ; IOReactorConfig ioReactorConfig = IOReactorConfig . custom ( ) . setConnectTimeout ( httpClientConfig . getConnTimeout ( ) ) . setSoTimeout ( httpClientConfig . getReadTimeout ( ) ) . build ( ) ; Registry < SchemeIOSessionStrategy > sessionStrategyRegistry = RegistryBuilder . < SchemeIOSessionStrategy > create ( ) . register ( "http" , httpClientConfig . getHttpIOSessionStrategy ( ) ) . register ( "https" , httpClientConfig . getHttpsIOSessionStrategy ( ) ) . build ( ) ; try { retval = new PoolingNHttpClientConnectionManager ( new DefaultConnectingIOReactor ( ioReactorConfig ) , sessionStrategyRegistry ) ; } catch ( IOReactorException e ) { throw new IllegalStateException ( e ) ; } final Integer maxTotal = httpClientConfig . getMaxTotalConnection ( ) ; if ( maxTotal != null ) { retval . setMaxTotal ( maxTotal ) ; } final Integer defaultMaxPerRoute = httpClientConfig . getDefaultMaxTotalConnectionPerRoute ( ) ; if ( defaultMaxPerRoute != null ) { retval . setDefaultMaxPerRoute ( defaultMaxPerRoute ) ; } final Map < HttpRoute , Integer > maxPerRoute = httpClientConfig . getMaxTotalConnectionPerRoute ( ) ; for ( Map . Entry < HttpRoute , Integer > entry : maxPerRoute . entrySet ( ) ) { retval . setMaxPerRoute ( entry . getKey ( ) , entry . getValue ( ) ) ; } return retval ; }
Extension point