Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default, if the cxf-rt-transports-http-hc module is found on the classpath, CXF will use the HttpAsyncClient based implementation for any Async calls, but will continue to use the HttpURLConnection based transport for synchronous calls. This allows a good balance of performance for the common synchronous cases with scalability for the asynchronous cases. However, using a contextual property of "use.async.http.conduit" and set to true/false, you can control whether the async or blocking version is used. If "true", the HttpAsyncClient will be used even for synchronous calls, if "false", asynchronous calls will rely on the traditional method of using HTTPURLConnection along with a work queue to mimic the asynchronocity.  And if TLSClientParameters sets an SSLSocketFactory,  as SocketFactory class and SocketFactory#createSocket methods in particular are inherently blocking and sockets instantiated in such a way cannot be used for asynchronous, so this lead to use the HttpURLConnection based transport.

Another reason to use the asynchronous transport is to use HTTP methods that HttpURLConnection does not support. For example, the github.com REST API specifies the use of PATCH for some cases, but HttpURLConnection rejects PATCH.

...