Skip to main content

Configuring the underlying Apache HTTP Components HttpAsyncClient objects

The Asynchronous HTTP Transport has several options that can set using Bus properties or via the OSGi configuration services to control various aspects of the underlying Apache HTTP Components HttpAsyncClient objects.

Settings related to the underlying TCP socket (see the java.net.Socket JavaDoc for a definition of these values):

Option

org.apache.cxf.transport.http.async.TCP_NODELAY (Default true)

org.apache.cxf.transport.http.async.SO_KEEPALIVE

org.apache.cxf.transport.http.async.SO_LINGER

org.apache.cxf.transport.http.async.SO_TIMEOUT

Settings related to Keep-Alive connection management:

Option

Description

org.apache.cxf. transport.http.async. CONNECTION_TTL

Maximum time a connection is held open in ms. Default is 60000.

org.apache.cxf. transport.http.async. MAX_CONNECTIONS

Maximum number of connections opened per host. Default is 1000.

org.apache.cxf. transport.http.async. MAX_PER_HOST_CONNECTIONS

Maximum number of connections opened in total. Default is 5000.

Settings related to Apache HttpAsyncClient threads and selectors:

Option

Description

org.apache.cxf. transport.http.async. ioThreadCount

Number of threads HttpAsyncClient uses to process IO events. Default is "-1" which means one thread per CPU core.

org.apache.cxf. transport.http.async. interestOpQueued

true/false for whether the interest ops are queues or process directly.

org.apache.cxf. transport.http.async. selectInterval

Default 1000 ms. How often the selector thread wakes up if there are no events to process additional things like queue expirations.

Settings to control which conduit is used:

Option

Values

Description

org.apache.cxf. transport.http.async. usePolicy

ALWAYS, ASYNC_ONLY, NEVER

Similar in meaning to the "use.async.http.conduit" context property described above. Whether to use the HttpAsyncClient: ALWAYS for both synchronous and asynchronous calls, ASYNC_ONLY (default) for asynchronous calls only, NEVER will use HTTPURLConnection for both types of calls.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!