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):
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eRetryOptions\u003c/code\u003e is a class that provides a way to configure the retry strategy for tasks, allowing specification of multiple options in a single \u003ccode\u003eRetryOptions\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe preferred method for creating a \u003ccode\u003eRetryOptions\u003c/code\u003e object involves static imports from \u003ccode\u003eBuilder.*\u003c/code\u003e and using a static creation method followed by instance mutators, such as \u003ccode\u003ewithTaskRetryLimit(10).taskAgeLimitSeconds("4d")\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to define parameters such as \u003ccode\u003emaxBackoffSeconds\u003c/code\u003e, \u003ccode\u003emaxDoublings\u003c/code\u003e, \u003ccode\u003eminBackoffSeconds\u003c/code\u003e, \u003ccode\u003etaskAgeLimitSeconds\u003c/code\u003e, and \u003ccode\u003etaskRetryLimit\u003c/code\u003e, all of which can be chained together.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etaskRetryLimit\u003c/code\u003e and \u003ccode\u003etaskAgeLimitSeconds\u003c/code\u003e methods can be used together, where both limits have to be exceeded before the task can be considered a permanent failure.\u003c/p\u003e\n"]]],[],null,["# Class RetryOptions (2.0.0)\n\n public final class RetryOptions implements Serializable\n\nContains various options for a task's retry strategy. Calls to [RetryOptions](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.RetryOptions) methods may\nbe chained to specify multiple options in the one [RetryOptions](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.RetryOptions) object.\n\nNotes on usage: \n\nThe recommended way to instantiate a [RetryOptions](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.RetryOptions) object is to statically import Builder.\\* and invoke a static creation method followed by an instance mutator (if needed): \n\n\n import static com.google.appengine.api.taskqueue.RetryOptions.Builder.*;\n\n ...\n RetryOptions retry = withTaskRetryLimit(10).taskAgeLimitSeconds(\"4d\")\n .minBackoffSeconds(120).maxBackoffSeconds(3600).maxDoublings(5);\n /appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.QueueFactory#com_google_appengine_api_taskqueue_QueueFactory_getDefaultQueue__.add(retryOptions(retry));\n \nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e RetryOptions \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### RetryOptions(RetryOptions options)\n\n public RetryOptions(RetryOptions options)\n\nMethods\n-------\n\n### equals(Object obj)\n\n public boolean equals(Object obj)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\n\n### maxBackoffSeconds(double maxBackoffSeconds)\n\n public RetryOptions maxBackoffSeconds(double maxBackoffSeconds)\n\nSets the maximum retry backoff interval, in seconds.\n\n### maxDoublings(int maxDoublings)\n\n public RetryOptions maxDoublings(int maxDoublings)\n\nSets the maximum times the retry backoff interval should double before rising linearly to the\nmaximum.\n\n### minBackoffSeconds(double minBackoffSeconds)\n\n public RetryOptions minBackoffSeconds(double minBackoffSeconds)\n\nSets the minimum retry backoff interval, in seconds.\n\n### taskAgeLimitSeconds(long taskAgeLimitSeconds)\n\n public RetryOptions taskAgeLimitSeconds(long taskAgeLimitSeconds)\n\nSets the maximum age from the first attempt to execute a task after which any new task failure\ncan be permanent. If both taskRetryLimit and taskAgeLimitSeconds are specified, then both\nlimits must be exceeded before a task can fail permanently.\n\n### taskRetryLimit(int taskRetryLimit)\n\n public RetryOptions taskRetryLimit(int taskRetryLimit)\n\nSets the number of retries allowed before a task can fail permanently. If both taskRetryLimit\nand taskAgeLimitSeconds are specified, then both limits must be exceeded before a task can fail\npermanently.\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]