java - Apache camel Connection pool timeout with restlet even after configuring component options -


i have camel java dsl route invokes restlet endpoint. , route works without issues when hit same manually. but, when try pump larger number of requests through code i'm getting "timeout waiting connection pool"

and following stackt-race of same:

2016-01-29 14:09:38.650  warn 20256 --- [pool-3-thread-2] org.restlet                              : error occurred during communication remote http server.org.apache.http.conn.connectionpooltimeoutexception: timeout waiting connection pool @ org.apache.http.impl.conn.tsccm.connpoolbyroute.getentryblocking(connpoolbyroute.java:412) @ org.apache.http.impl.conn.tsccm.connpoolbyroute$1.getpoolentry(connpoolbyroute.java:298) @ org.apache.http.impl.conn.tsccm.threadsafeclientconnmanager$1.getconnection(threadsafeclientconnmanager.java:238) @ org.apache.http.impl.client.defaultrequestdirector.execute(defaultrequestdirector.java:423) @ org.apache.http.impl.client.abstracthttpclient.doexecute(abstracthttpclient.java:863) @ org.apache.http.impl.client.closeablehttpclient.execute(closeablehttpclient.java:82) @ org.apache.http.impl.client.closeablehttpclient.execute(closeablehttpclient.java:106) @ org.apache.http.impl.client.closeablehttpclient.execute(closeablehttpclient.java:57) @ org.restlet.ext.httpclient.internal.httpmethodcall.sendrequest(httpmethodcall.java:339) @ org.restlet.engine.adapter.clientadapter.commit(clientadapter.java:105) @ org.restlet.engine.adapter.httpclienthelper.handle(httpclienthelper.java:119) @ org.restlet.client.handle(client.java:153) @ org.restlet.restlet.handle(restlet.java:275) @ org.apache.camel.component.restlet.restletproducer.process(restletproducer.java:79) @ org.apache.camel.component.restlet.restletproducer.process(restletproducer.java:98) @ org.apache.camel.processor.sendprocessor.process(sendprocessor.java:141) @ org.apache.camel.management.instrumentationprocessor.process(instrumentationprocessor.java:77) @ org.apache.camel.processor.redeliveryerrorhandler.process(redeliveryerrorhandler.java:460) @ org.apache.camel.processor.camelinternalprocessor.process(camelinternalprocessor.java:190) @ org.apache.camel.processor.pipeline.process(pipeline.java:121) @ org.apache.camel.processor.pipeline.process(pipeline.java:83) @ org.apache.camel.processor.redeliveryerrorhandler.process(redeliveryerrorhandler.java:460) @ org.apache.camel.processor.camelinternalprocessor.process(camelinternalprocessor.java:190) @ org.apache.camel.processor.multicastprocessor.doprocesssequential(multicastprocessor.java:668) @ org.apache.camel.processor.multicastprocessor.doprocesssequential(multicastprocessor.java:596) @ org.apache.camel.processor.multicastprocessor.process(multicastprocessor.java:237) @ org.apache.camel.processor.splitter.process(splitter.java:104) @ org.apache.camel.management.instrumentationprocessor.process(instrumentationprocessor.java:77) @ org.apache.camel.processor.redeliveryerrorhandler.process(redeliveryerrorhandler.java:460) @ org.apache.camel.processor.camelinternalprocessor.process(camelinternalprocessor.java:190) @ org.apache.camel.processor.pipeline.process(pipeline.java:121) @ org.apache.camel.processor.pipeline.process(pipeline.java:83) @ org.apache.camel.processor.camelinternalprocessor.process(camelinternalprocessor.java:190) @ org.apache.camel.component.direct.directproducer.process(directproducer.java:62) @ org.apache.camel.processor.sendprocessor.process(sendprocessor.java:141) @ org.apache.camel.management.instrumentationprocessor.process(instrumentationprocessor.java:77) @ org.apache.camel.processor.camelinternalprocessor.process(camelinternalprocessor.java:190) @ org.apache.camel.processor.redeliveryerrorhandler.process(redeliveryerrorhandler.java:460) @ org.apache.camel.processor.camelinternalprocessor.process(camelinternalprocessor.java:190) @ org.apache.camel.util.asyncprocessorhelper.process(asyncprocessorhelper.java:109) @ org.apache.camel.processor.multicastprocessor.doprocessparallel(multicastprocessor.java:814) @ org.apache.camel.processor.multicastprocessor.access$200(multicastprocessor.java:84) @ org.apache.camel.processor.multicastprocessor$1.call(multicastprocessor.java:314) @ org.apache.camel.processor.multicastprocessor$1.call(multicastprocessor.java:299) @ java.util.concurrent.futuretask.run(futuretask.java:266) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745) 

and per doc did configure restlet component following code i'm still seeing same issue:

    @bean public restletcomponent restlet() {     restletcomponent restlet = new restletcomponent();     restlet.setmaxthreads(100);     restlet.setthreadmaxidletimems(10000);     restlet.setmaxqueued(20);     return restlet; } 

note: route did accepted 10 requests @ time started getting errors. , configuration see maxthreads default 10. means did through bean not picking properly.

actually in code have defined restlet bean after route configure i.e below

public class routesbuilder extends fatjarrouter {  ....  @override     public void configure() throws jaxbexception {     ...... }  @bean(name={"restlet"})     public restletcomponent restlet()     {         .......     } } 

and have changed order of defining code i.e first have defined restlet , route configure below. in place saw restlet configuration been picked , no more see connection pool issue.

public class routesbuilder extends fatjarrouter {  ....  @bean(name={"restlet"})     public restletcomponent restlet()     {         .......     }  @override     public void configure() throws jaxbexception {     ...... }   } 

Comments