Les Novell created CAMEL-9109:
---------------------------------

             Summary: AHC creating thread for each connection
                 Key: CAMEL-9109
                 URL: https://issues.apache.org/jira/browse/CAMEL-9109
             Project: Camel
          Issue Type: Bug
          Components: camel-ahc
    Affects Versions: 2.16.0
         Environment: Noted on Mac OS X
            Reporter: Les Novell


The AHC component seems to create worker threads on the thread pool for every 
(concurrent?) client request.  I assume, by design, it's expected that AHC is 
non-blocking and uses only a small number of threads even under low load.

I created a simple route to test asynchronous message passing in Camel.  When 
testing the route by creating 1000 simultaneous connections I see that around 
over 1000 threads are created to handle requests I'm forwarding on using AHC 
component.  

I am surprised, I thought that AHC component would use non-blocking 
asynchronous I/O, and a low number of threads. 

Basic Route: 
        restConfiguration().component("jetty").host("localhost").port(8081); 
        rest("/ud").get("/wait/{timeout}") 
                .to("direct:mockEndpoint").bindingMode(RestBindingMode.off); 
        from("direct:mockEndpoint") 
                .removeHeaders("CamelHttpPath") 
                
.toD("ahc:http://localhost:9000/wait/${headers.timeout}?bridgeEndpoint=true";); 

It appears that the AHC component is creating worker threads to manage outgoing 
connections to localhost:9000. One for every connection made to localhost:9090. 
 

Camel version is 2.16-SNAPSHOT 




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to