You can set the backoff policy on any HttpRequest, such as:
ResponseObj obj = service.resource().method()
.setBackOffPolicy(...)
.execute();
Or, if you want to use the exponential back-off policy for all requests, set it up in the HttpRequestInitializer when you set up the service:
Service service = new Service(httpTransport, jsonFactory, new HttpRequestInitializer() {
@Override
public void initialize(HttpRequest req) {
req.setBackOffPolicy(...);
// Do any other initialization here, such as using a Credential to make authorized requests.
}
});
service.resource().method().execute(); // <-- this request will use the back-off policy you set
- Jason