daihuanhuan commented on issue #4003:
URL: https://github.com/apache/shenyu/issues/4003#issuecomment-1260342560
How do I check it? The corresponding parameters have been sent httpclient
plugin.
The corresponding code is as follows: But the timeout doesn't work
```
final Duration duration = Duration.ofMillis(timeout);
final int retryTimes = (int)
Optional.ofNullable(exchange.getAttribute(Constants.HTTP_RETRY)).orElse(0);
final String retryStrategy = (String)
Optional.ofNullable(exchange.getAttribute(Constants.RETRY_STRATEGY)).orElseGet(RetryEnum.CURRENT::getName);
LOG.info("The request urlPath is {}, retryTimes is {}, retryStrategy
is {}", uri.toASCIIString(), retryTimes, retryStrategy);
final HttpHeaders httpHeaders = buildHttpHeaders(exchange);
final Mono<R> response = doRequest(exchange,
exchange.getRequest().getMethodValue(), uri, httpHeaders,
exchange.getRequest().getBody())
.timeout(duration, Mono.error(new TimeoutException("Response
took longer than timeout: " + duration)))
.doOnError(e -> LOG.error(e.getMessage(), e));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]