通过 Dropwizard 使用 Spring 重试

问题描述 投票:0回答:3

是否可以在 dropwizard 中使用 spring-retry ?或者,为此,dropwizard 中有类似 spring-retry 的东西吗?

dropwizard spring-retry
3个回答
0
投票

不确定 spring retry 的作用,但对于客户端重试,您可以配置

retries
HttpClient

httpClient:
  timeout: 500ms
  retries: 3

重试失败请求的次数。仅当请求抛出

InterruptedIOException
UnknownHostException
ConnectException
SSLException
以外的异常时才会重试。

请参阅 Dropwizard 文档


0
投票

来自 Spring Batch - 参考文档9。重试:

从 2.2.0 开始,重试功能已从 Spring Batch 中删除。它现在是新库 Spring Retry 的一部分。

Spring Retry可以独立于其他Spring项目使用。

例如在 Maven 项目中,您只需在 POM 中添加以下内容即可:

<dependency>
    <groupId>org.springframework.retry</groupId>
    <artifactId>spring-retry</artifactId>
    <version>1.1.5.RELEASE</version>
</dependency>

0
投票

有人能解决这个问题吗?你能在 Dropwizard 项目中使用 spring-retry 吗?

© www.soinside.com 2019 - 2024. All rights reserved.