When using CloseableHttpAsyncClient
, the call back we provide FutureCallback
has completed, failed, and cancelled callback methods. For any failures, the failed callback will be called with exception. This can be due to many things starting from connection pool manager to an exception in the remote server (and closing the connection or not responding within the time etc).
My question is, how can we deterministically figure out whether the failure happened before or after connecting to the remote host? My requirement is that, if my application connects to the remote host and then a failure happens, I will have to handle differently and if the failure happens before the connection successfully happens, I will have to handle it in another way.