The AHC component calls external servers using the HTTP protocol. Learn how to use the AHC component.


To install camel-ahc you can use the managed libraries or manually upload the library jars with their dependencies.


Now it's possible to create a route that uses this component. Here the definition of the route:

<routes xmlns="http://camel.apache.org/schema/spring" xmlns:u="http://www.systar.com/aluminium/camel-util">
        <!-- Call only one time -->
        <from uri="timer:one?repeatCount=10"/>
        <!-- Send the HTTP request and convert the result as String -->
        <to uri="ahc:https://www.google.com/humans.txt"/>
        <convertBodyTo type="java.lang.String"/>
        <!-- Log the result -->
        <to uri="log:robots"/>

Related Links