在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一起使用的方式,那是什么意思?