I have a route like the following to a dynamic computed HTTP URL:
from("file:in")
.recipientList(simple(jettyUrl + "?id=${exchangeId}"))
.to("file:out?fileName=abc");
as it is described in the FAQ:
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
Each time an exchange is processed a new jetty component with a new threadpool is created. The threadpool is newer released. After a couple of exchanges the threads are exhausted.
I'am using Camel 2.12.2. In that version it is not possible anymore to set an httpClient instance or an executor to the jetty component to prevent the leak. The options httpClientThreadPool and httpClient that would be useful have been removed in camel 2.11.
How can I request an HTTP Url containing query parameters without leaking threads.
Maybe my approach is wrong and somebody can point me in the right direction.
My approach was wrong. By using an HTTP_QUERY or HTTP_URI header the recipientList is not needed anymore and only one endpoint is created. As a result there is no thread leak anymore.
.setHeader(Exchange.HTTP_URI, simple("http://somehost3244.org/id=${exchangeId}"))
.to("jetty:http://dummyhost243242.org")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With