title: Apache camel Connection pool timeout with restlet even after configuring component options
body: <p>I have a camel Java DSL route which invokes a restlet endpoint. And the route works without any issues when I hit the same manually. But, when I try to pump a larger number of requests through code I'm getting "<strong>Timeout waiting for connection from pool</strong>"</p>
  
  <p>And the following is stackt-race of the same: </p>
  
  <pre><code>2016-01-29 14:09:38.650  WARN 20256 --- [pool-3-thread-2] org.restlet                              : An error occurred during the communication with the remote HTTP server.org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
  at org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:412)
  at org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:298)
  at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:238)
  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:423)
  at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
  at org.restlet.ext.httpclient.internal.HttpMethodCall.sendRequest(HttpMethodCall.java:339)
  at org.restlet.engine.adapter.ClientAdapter.commit(ClientAdapter.java:105)
  at org.restlet.engine.adapter.HttpClientHelper.handle(HttpClientHelper.java:119)
  at org.restlet.Client.handle(Client.java:153)
  at org.restlet.Restlet.handle(Restlet.java:275)
  at org.apache.camel.component.restlet.RestletProducer.process(RestletProducer.java:79)
  at org.apache.camel.component.restlet.RestletProducer.process(RestletProducer.java:98)
  at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:141)
  at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
  at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
  at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
  at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:668)
  at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:596)
  at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:237)
  at org.apache.camel.processor.Splitter.process(Splitter.java:104)
  at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
  at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
  at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
  at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:141)
  at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
  at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
  at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
  at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:814)
  at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:84)
  at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:314)
  at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:299)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>And as per the doc I did configure the restlet component with the following code but I'm still seeing the same issue:</p>
  
  <pre><code>    @Bean
  public RestletComponent restlet()
  {
      RestletComponent restlet = new RestletComponent();
      restlet.setMaxThreads(100);
      restlet.setThreadMaxIdleTimeMs(10000);
      restlet.setMaxQueued(20);
      return restlet;
  }
  </code></pre>
  
  <p><strong>Note: The route did accepted 10 requests at a time then I started getting errors. And from configuration I could see the maxThreads by default is 10. Which means the that I did through Bean is not picking up properly.</strong></p>