as we discussed about circuit breaker module from resilience4j earlier, let's see what Retry module actually offers What is Retry in Resilience4j? this module offers ways of handling failure transaction by automatically retrying those transactions as per properties we configure. let's check how it works in this article. below code shows, how we can add retry annotation to our feign client Note: There is no need to add a fallbackMethod in the @Retry annotation if it is already defined in @CircuitBreaker . @GetMapping("/users/{userId}/albums") @Retry(name="album-service") @CircuitBreaker(name = "album-service", fallbackMethod = "getAlbumsFallbackMethod") public List<AlbumResponseModel> getAlbums(@PathVariable String userId); default List<AlbumResponseModel> getAlbumsFallbackMethod(String userId, Throwable exception) { System.out.println("user id" + userId); System.out.println("exc...
as we discussed about circuit breaker module from resilience4j earlier, let's see what Retry module actually offers What is Retry in Resilience4j? this module offers ways of handling failure transaction by automatically retrying those transactions as per properties we configure. let's check how it works in this article. below code shows, how we can add retry annotation to our feign client Note: There is no need to add a fallbackMethod in the @Retry annotation if it is already defined in @CircuitBreaker . @GetMapping("/users/{userId}/albums") @Retry(name="album-service") @CircuitBreaker(name = "album-service", fallbackMethod = "getAlbumsFallbackMethod") public List<AlbumResponseModel> getAlbums(@PathVariable String userId); default List<AlbumResponseModel> getAlbumsFallbackMethod(String userId, Throwable exception) { System.out.println("user id" + userId); System.out.println("exc...