private HttpAsyncClient buildHttpAsyncClient ( ) throws IOReactorException { // Create I/O reactor configuration IOReactorConfig ioReactorConfig = IOReactorConfig . custom ( ) . setConnectTimeout ( connectTimeout ) . setSoTimeout ( socketTimeout ) . build ( ) ; // Create a custom I/O reactor ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor ( ioReactorConfig ) ; // Create a connection manager with simple configuration. PoolingNHttpClientConnectionManager connManager = new PoolingNHttpClientConnectionManager ( ioReactor ) ; // Configure total max or per route limits for persistent connections // that can be kept in the pool or leased by the connection manager. connManager . setMaxTotal ( maxTotal ) ; connManager . setDefaultMaxPerRoute ( defaultMaxPerRoute ) ; return httpAsyncClient = HttpAsyncClients . custom ( ) . useSystemProperties ( ) . setConnectionManager ( connManager ) . build ( ) ; }
Creates an instance of async http client .