code: private Duration determineDelayDuration(HttpResponse response) {
          int code = response.statusCode();
  
          // Response will not have a retry-after-ms header.
          if (code != HttpResponseStatus.TOO_MANY_REQUESTS.code()
              && code != HttpResponseStatus.SERVICE_UNAVAILABLE.code()) {
              return this.delayDuration;
          }
  
          String retryHeader = response.headerValue(RETRY_AFTER_MS_HEADER);
  
          // Retry header is missing or empty, return the default delay duration.
          if (retryHeader == null || retryHeader.isEmpty()) {
              return this.delayDuration;
          }
  
          // Use the response delay duration, the server returned it for a reason.
          return Duration.ofMillis(Integer.parseInt(retryHeader));
      }
docs: Determines the delay duration that should be waited before retrying.
  @param response HTTP response
  @return If the HTTP response has a retry-after-ms header that will be returned,
  otherwise the duration used during the construction of the policy.