Class RetryOptions (2.0.0)

public final class RetryOptions implements Serializable

Contains various options for a task's retry strategy. Calls to RetryOptions methods may be chained to specify multiple options in the one RetryOptions object.

Notes on usage:
The recommended way to instantiate a RetryOptions object is to statically import Builder.* and invoke a static creation method followed by an instance mutator (if needed):


 import static com.google.appengine.api.taskqueue.RetryOptions.Builder.*;

 ...
 RetryOptions retry = withTaskRetryLimit(10).taskAgeLimitSeconds("4d")
     .minBackoffSeconds(120).maxBackoffSeconds(3600).maxDoublings(5);
 QueueFactory#getDefaultQueue().add(retryOptions(retry));
 

Inheritance

Object > RetryOptions

Implements

Serializable

Constructors

RetryOptions(RetryOptions options)

public RetryOptions(RetryOptions options)
Parameter
NameDescription
optionsRetryOptions

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

maxBackoffSeconds(double maxBackoffSeconds)

public RetryOptions maxBackoffSeconds(double maxBackoffSeconds)

Sets the maximum retry backoff interval, in seconds.

Parameter
NameDescription
maxBackoffSecondsdouble

Seconds value for the maximum backoff interval.

Returns
TypeDescription
RetryOptions

the RetryOptions object for chaining.

maxDoublings(int maxDoublings)

public RetryOptions maxDoublings(int maxDoublings)

Sets the maximum times the retry backoff interval should double before rising linearly to the maximum.

Parameter
NameDescription
maxDoublingsint

The number of allowed doublings. Must not be negative.

Returns
TypeDescription
RetryOptions

the RetryOptions object for chaining.

minBackoffSeconds(double minBackoffSeconds)

public RetryOptions minBackoffSeconds(double minBackoffSeconds)

Sets the minimum retry backoff interval, in seconds.

Parameter
NameDescription
minBackoffSecondsdouble

Seconds value for the minimum backoff interval.

Returns
TypeDescription
RetryOptions

the RetryOptions object for chaining.

taskAgeLimitSeconds(long taskAgeLimitSeconds)

public RetryOptions taskAgeLimitSeconds(long taskAgeLimitSeconds)

Sets the maximum age from the first attempt to execute a task after which any new task failure can be permanent. If both taskRetryLimit and taskAgeLimitSeconds are specified, then both limits must be exceeded before a task can fail permanently.

Parameter
NameDescription
taskAgeLimitSecondslong

The age limit in seconds. Must not be negative.

Returns
TypeDescription
RetryOptions

the RetryOptions object for chaining.

taskRetryLimit(int taskRetryLimit)

public RetryOptions taskRetryLimit(int taskRetryLimit)

Sets the number of retries allowed before a task can fail permanently. If both taskRetryLimit and taskAgeLimitSeconds are specified, then both limits must be exceeded before a task can fail permanently.

Parameter
NameDescription
taskRetryLimitint
Returns
TypeDescription
RetryOptions

toString()

public String toString()
Returns
TypeDescription
String
Overrides