-
-
Notifications
You must be signed in to change notification settings - Fork 5
Timeout and maximum retries
Ahmad K. Bawaneh edited this page Mar 16, 2020
·
3 revisions
Sometimes requests might timeout due to network latency or other reasons and we dont 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})
@Retries(timeout=3000, maxRetries=5)
void updateMovie(@BeanParam @RequestBody Movie movie);
}
the updateMovie
will timeout 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.
- Home
- Quick start
- Sharing clients
-
Configuration
- Locating resource classes
- Service root
- Resource root
- Http methods
- Service method path mapping
- Service path
- Query parameters
- Path parameters
- Header parameters
- Date format
- Request body
- Request and Response mapping
- Produces and Consumes
- Success codes
- Timeout and maximum retries
- With credentials
- Custom request URL
- Global interceptors
- Default failed response handler
- Interface inheritance
- Multipart form data