HTTP Async Transport

Stable • Since 1.1.0

Implement async SOAP Clients using Apache HttpComponents HttpClient 5.

Maven coordinates

Create a new project using quarkus-cxf-rt-transports-http-hc5 on or add these coordinates to your existing project:


Check the User guide and especially its Dependency management section for more information about writing applications with Quarkus CXF.


Once the quarkus-cxf-rt-transports-http-hc5 dependency is available in the classpath, CXF will use HttpAsyncClient for asynchronous calls and will continue using HttpURLConnection for synchronous calls.

Generate async methods

Asynchronous client invocations require some additional methods in the service endpoint interface. That code is not generated by default.

To enable it, you need to create a JAX-WS binding file with enableAsyncMapping set to true:

The sample code snippets used in this section come from the HC5 integration test in the source tree of Quarkus CXF

<?xml version="1.0"?>
    <bindings node="wsdl:definitions">

This file should then be passed to wsdl2java through its additional-params property:
quarkus.cxf.codegen.wsdl2java.includes = wsdl/*.wsdl
quarkus.cxf.codegen.wsdl2java.additional-params = -b,src/main/resources/wsdl/async-binding.xml

Asynchronous Clients and Mutiny

Once the asynchronous stubs are available, it is possible to wrap a client call in io.smallrye.mutiny.Uni as shown below:


import java.util.concurrent.Future;

import jakarta.inject.Inject;

import org.jboss.eap.quickstarts.wscalculator.calculator.AddResponse;
import org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService;

import io.quarkiverse.cxf.annotation.CXFClient;
import io.smallrye.mutiny.Uni;

public class Hc5Resource {

    @CXFClient("myCalculator") // name used in
    CalculatorService myCalculator;

    public Uni<Integer> addAsync(@QueryParam("a") int a, @QueryParam("b") int b) {
        return Uni.createFrom()
                        (Future<AddResponse>) myCalculator
                                .addAsync(a, b, res -> {
                .map(addResponse -> addResponse.getReturn());


Thread pool

Asynchronous clients delivered by this extension leverage ManagedExecutor with a thread pool provided by Quarkus. The thread pool can be configured using the quarkus.thread-pool.* family of options. As a consequence of this, the executor and thread pool related attributes of org.apache.cxf.transports.http.configuration.HTTPClientPolicy are not honored for async clients on Quarkus.

You can see more details about the CXF asynchronous client and how to tune it further in CXF documentation.