// Set the maximum time in millisecond an AsyncHttpClient can stay idle:
// AsyncHttpClientConfig.Builder setIdleConnectionTimeoutInMs(int defaultIdleConnectionTimeoutInMs)
// Override the Ning Async Client's reaper behavior
ScheduledExecutorService reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(),
new NamingThreadFactory("CHMQ-HttpClient-Reaper", true));
httpConfigBuilder.setScheduledExecutorService(reaper);
// Override the Ning Async Client's worker thread pool behavior
ExecutorService applicationThreadPool = Executors.newFixedThreadPool((Runtime.getRuntime().availableProcessors() * 2)+1,
new NamingThreadFactory("CHMQ-HttpClient-Callback", true));
httpConfigBuilder.setExecutorService(applicationThreadPool);
httpConfigBuilder.setIOThreadMultiplier(2); //This is the default
http = new AsyncHttpClient(httpConfigBuilder.build());