OpenFeign/feign

Using ResponseInterceptor : add request execution elapsedTime to the InvocationContext

Opened this issue · 0 comments

I'm implementing the ResponseInterceptor interface to provide informations about each HTTP request to my users.
I wanted to display the request execution elapsedTime, but this data is not present in the InvocationContext.

in ResponseHandler, this could be as simple as

public Object handleResponse(
      String configKey, Response response, Type returnType, long elapsedTime) throws Exception {
    try {
      response = logAndRebufferResponseIfNeeded(configKey, response, elapsedTime);
      return executionChain.next(
          new InvocationContext(
              configKey,
              decoder,
              errorDecoder,
              dismiss404,
              closeAfterDecode,
              decodeVoid,
              response,
              returnType,
              elapsedTime));