Sometimes requests might time-out due to network latency or other reasons, and we don't want our requests to fail directly but rather want to retry several times before we end up failing the request. in domino-rest we can use the @Retries annotation to define a timeout with maximum retries count.
@RequestFactory
public interface MoviesService {
@Path("library/movies/:movieName")
@GET
Movie getMovieByName(@PathParam("movieName") String movieName);
@Path("library/movies")
@GET
List<Movie> listMovies();
@Path("library/movies/:name")
@PUT
@SuccessCodes({200})
void updateMovie(@beanParam @RequestBody Movie movie);
}
The updateMovie request will time-out if the response not returned within 3000 milliseconds but will try 5 times before it actually fail.
We can also set a global timeout and max retries in a global interceptor which is documented in other parts of this wiki.