是否可以在 dropwizard 中使用 spring-retry ?或者,为此,dropwizard 中有类似 spring-retry 的东西吗?
不确定 spring retry 的作用,但对于客户端重试,您可以配置
retries
为 HttpClient
httpClient:
timeout: 500ms
retries: 3
重试失败请求的次数。仅当请求抛出
InterruptedIOException
、UnknownHostException
、ConnectException
或 SSLException
以外的异常时才会重试。
请参阅 Dropwizard 文档
从 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>
有人能解决这个问题吗?你能在 Dropwizard 项目中使用 spring-retry 吗?