Class LocalActivityOptions.Builder
- java.lang.Object
-
- io.temporal.activity.LocalActivityOptions.Builder
-
- Enclosing class:
- LocalActivityOptions
public static final class LocalActivityOptions.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalActivityOptions
build()
LocalActivityOptions.Builder
mergeActivityOptions(LocalActivityOptions override)
LocalActivityOptions.Builder
setDoNotIncludeArgumentsIntoMarker(boolean doNotIncludeArgumentsIntoMarker)
When set to true, the serialized arguments of the local Activity are not included in the Marker Event that stores the local Activity's invocation result.LocalActivityOptions.Builder
setLocalRetryThreshold(java.time.Duration localRetryThreshold)
Maximum time to wait between retries locally, while keeping the Workflow Task open via a Heartbeat.LocalActivityOptions.Builder
setMethodRetry(MethodRetry r)
MergesMethodRetry
annotation.LocalActivityOptions.Builder
setRetryOptions(RetryOptions retryOptions)
RetryOptions
that define how an Activity is retried in case of failure.LocalActivityOptions.Builder
setScheduleToCloseTimeout(java.time.Duration timeout)
Total time that a workflow is willing to wait for an Activity to complete.LocalActivityOptions.Builder
setScheduleToStartTimeout(java.time.Duration timeout)
Time that the Activity Task can stay in the Worker's internal Task Queue of Local Activities until it's picked up by the Local Activity Executor.LocalActivityOptions.Builder
setStartToCloseTimeout(java.time.Duration timeout)
Maximum time of a single Activity attempt.LocalActivityOptions
validateAndBuildWithDefaults()
-
-
-
Method Detail
-
setScheduleToCloseTimeout
public LocalActivityOptions.Builder setScheduleToCloseTimeout(java.time.Duration timeout)
Total time that a workflow is willing to wait for an Activity to complete.ScheduleToCloseTimeout limits the total time of an Activity's execution including retries (use
setStartToCloseTimeout(Duration)
to limit the time of a single attempt).Either this option or
setStartToCloseTimeout(Duration)
is required.Defaults to unlimited.
-
setScheduleToStartTimeout
public LocalActivityOptions.Builder setScheduleToStartTimeout(java.time.Duration timeout)
Time that the Activity Task can stay in the Worker's internal Task Queue of Local Activities until it's picked up by the Local Activity Executor.ScheduleToStartTimeout is always non-retryable. Retrying after this timeout doesn't make sense as it would just put the Activity Task back into the same Task Queue.
Defaults to unlimited.
-
setStartToCloseTimeout
public LocalActivityOptions.Builder setStartToCloseTimeout(java.time.Duration timeout)
Maximum time of a single Activity attempt.If
setScheduleToCloseTimeout(Duration)
is not provided, then this timeout is required.
-
setLocalRetryThreshold
public LocalActivityOptions.Builder setLocalRetryThreshold(java.time.Duration localRetryThreshold)
Maximum time to wait between retries locally, while keeping the Workflow Task open via a Heartbeat. If the delay between the attempts becomes larger that this threshold, a Workflow Timer will be scheduled. Default value is Workflow Task Timeout multiplied by 3.
-
setRetryOptions
public LocalActivityOptions.Builder setRetryOptions(RetryOptions retryOptions)
RetryOptions
that define how an Activity is retried in case of failure.If not provided, the default activity retry policy is:
InitialInterval: 1 second BackoffCoefficient: 2 MaximumInterval: 100 seconds // 100 * InitialInterval MaximumAttempts: 0 // Unlimited NonRetryableErrorTypes: []
If both
setScheduleToCloseTimeout(Duration)
andRetryOptions.Builder.setMaximumAttempts(int)
are not set, the Activity will not be retried.To ensure zero retries, set
RetryOptions.Builder.setMaximumAttempts(int)
to 1.
-
setMethodRetry
public LocalActivityOptions.Builder setMethodRetry(MethodRetry r)
MergesMethodRetry
annotation. The values of this builder take precedence over annotated ones.
-
setDoNotIncludeArgumentsIntoMarker
public LocalActivityOptions.Builder setDoNotIncludeArgumentsIntoMarker(boolean doNotIncludeArgumentsIntoMarker)
When set to true, the serialized arguments of the local Activity are not included in the Marker Event that stores the local Activity's invocation result. The serialized arguments are included only for human troubleshooting as they are never read by the SDK code. In some cases, it is better to not include them to reduce the history size. The default value is set to false.
-
mergeActivityOptions
public LocalActivityOptions.Builder mergeActivityOptions(LocalActivityOptions override)
-
build
public LocalActivityOptions build()
-
validateAndBuildWithDefaults
public LocalActivityOptions validateAndBuildWithDefaults()
-
-