Replacement for Apache AbortableHttpRequest in httpclient5?

61 Views Asked by At

We have code for a proxy servlet that includes this:

//abort request, according to best practice with HttpClient
if (proxyRequest instanceof AbortableHttpRequest) {
    final AbortableHttpRequest abortableHttpRequest = (AbortableHttpRequest)proxyRequest;
        abortableHttpRequest.abort();
}

This bit of code was copied from some example many years ago. (You can find this code snippet in multiple tutorials with the same comment.)

In httpclient 4, AbortableHttpRequest was deprecated in favor of HttpExecutionAware. However, neither interface exists in httpclient 5.

Can anyone tell us if there is a recommended replacement for these interfaces in httpclient5?

Note that the httpclient5 migration document did not have any information about the removal of these interfaces.

1

There are 1 best solutions below

2
ok2c On

Use CancellableDependency or Cancellable interfaces instead.