Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9109

AHC creating thread for each connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.16.0
    • None
    • camel-ahc
    • None
    • Noted on Mac OS X

    • Unknown

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            lesnovell Les Novell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: