Spring文档暗示@EnableRetry和@Retryable与spring的伪装客户端一起工作。但这似乎没有

时间:2019-11-06 13:53:19

标签: java spring spring-boot spring-cloud-feign spring-retry

在spring文档here中,建议将Spring Retry添加为依赖项将使我们能够在Spring Feign客户端上启用它。

但是,当我尝试以下代码时:

@Component
@FeignClient(value = "myFeign", url = "${my.url}")
public interface ingestionInterface{
    @Retryable(
            value = {FeignException.class},
            backoff = @Backoff(delay=50000)
    )
    @RequestMapping(
            produces = "application/json",
            method = RequestMethod.POST)
    Optional<ResponseEntity<Response>> postRequest(@Valid @RequestBody Request request);
}

我的应用程序无法编译,并显示错误:

Bean named 'blah.blah.ingestionInterface' is expected to be of type 'blah.blah.ingestionInterface' but was actually of type 'com.sun.proxy.$Proxy143'

如果这不是将Spring Retry与Spring Feign一起使用的方式,那是什么意思?

0 个答案:

没有答案