Class WorkflowServiceStubsOptions.Builder
- java.lang.Object
-
- io.temporal.serviceclient.ServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>
-
- io.temporal.serviceclient.WorkflowServiceStubsOptions.Builder
-
- Enclosing class:
- WorkflowServiceStubsOptions
public static class WorkflowServiceStubsOptions.Builder extends ServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>
Builder is the builder for ClientOptions.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description WorkflowServiceStubsOptions
build()
Builds and returns a ClientOptions object.WorkflowServiceStubsOptions.Builder
setDisableHealthCheck(boolean disableHealthCheck)
Deprecated.Use more explicitWorkflowServiceStubs.newServiceStubs(WorkflowServiceStubsOptions)
that doesn't perform an explicit connection and health check.WorkflowServiceStubsOptions.Builder
setQueryRpcTimeout(java.time.Duration timeout)
Deprecated.WorkflowServiceStubsOptions.Builder
setRpcLongPollTimeout(java.time.Duration timeout)
Sets the rpc timeout value for the following long poll based operations: PollWorkflowTaskQueue, PollActivityTaskQueue, GetWorkflowExecutionHistory.WorkflowServiceStubsOptions.Builder
setRpcQueryTimeout(java.time.Duration rpcQueryTimeout)
Sets the rpc timeout value for query calls.WorkflowServiceStubsOptions.Builder
setRpcRetryOptions(RpcRetryOptions rpcRetryOptions)
Allows customization of retry options for the outgoing RPC calls to temporal service.WorkflowServiceStubsOptions.Builder
setRpcTimeout(java.time.Duration timeout)
Sets the rpc timeout value for non-query and non-long-poll calls.WorkflowServiceStubsOptions
validateAndBuildWithDefaults()
-
Methods inherited from class io.temporal.serviceclient.ServiceStubsOptions.Builder
addGrpcClientInterceptor, addGrpcMetadataProvider, setChannel, setChannelInitializer, setConnectionBackoffResetFrequency, setEnableHttps, setEnableKeepAlive, setGrpcClientInterceptors, setGrpcMetadataProviders, setGrpcReconnectFrequency, setHeaders, setHealthCheckAttemptTimeout, setHealthCheckTimeout, setKeepAlivePermitWithoutStream, setKeepAliveTime, setKeepAliveTimeout, setMetricsScope, setSslContext, setTarget
-
-
-
-
Method Detail
-
setDisableHealthCheck
@Deprecated public WorkflowServiceStubsOptions.Builder setDisableHealthCheck(boolean disableHealthCheck)
Deprecated.Use more explicitWorkflowServiceStubs.newServiceStubs(WorkflowServiceStubsOptions)
that doesn't perform an explicit connection and health check.If false, enables client to make a request to health check endpoint to make sure that the server is accessible.
-
setRpcTimeout
public WorkflowServiceStubsOptions.Builder setRpcTimeout(java.time.Duration timeout)
Sets the rpc timeout value for non-query and non-long-poll calls. Default is 10 seconds.This timeout is applied to only a single rpc server call, not a complete client-server interaction. In case of failure, the requests are automatically retried according to
setRpcRetryOptions(RpcRetryOptions)
. The full interaction is limited byRpcRetryOptions.Builder.setExpiration(Duration)
orRpcRetryOptions.Builder.setMaximumAttempts(int)
}, whichever happens first.For example, let's consider you've called
WorkflowClient#start
, and this timeout is set to 10s, whileRpcRetryOptions.Builder.setExpiration(Duration)
is set to 60s, and the server is responding slowly. The first two RPC calls may time out and be retried, but if the third one completes fast, the overallWorkflowClient#start
call will successfully resolve.- Overrides:
setRpcTimeout
in classServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>
- Returns:
this
-
setRpcLongPollTimeout
public WorkflowServiceStubsOptions.Builder setRpcLongPollTimeout(java.time.Duration timeout)
Sets the rpc timeout value for the following long poll based operations: PollWorkflowTaskQueue, PollActivityTaskQueue, GetWorkflowExecutionHistory. Defaults to 70 seconds.Server always responds below this timeout. Most users should never modify the default value of 70s. The only reasonable reason to modify this timeout it if there is a reversed proxy in the network that cuts the gRPC requests really short and there is no way to adjust it.
-
setRpcQueryTimeout
public WorkflowServiceStubsOptions.Builder setRpcQueryTimeout(java.time.Duration rpcQueryTimeout)
Sets the rpc timeout value for query calls. Default is 10 seconds.This timeout is applied to only a single rpc server call, not a complete client-server interaction. In case of failure, the requests are automatically retried according to
setRpcRetryOptions(RpcRetryOptions)
. The full interaction is limited byRpcRetryOptions.Builder.setExpiration(Duration)
orRpcRetryOptions.Builder.setMaximumAttempts(int)
}, whichever happens first.For example, let's consider you've called
WorkflowStub#query
, and this timeout is set to 10s, whileRpcRetryOptions.Builder.setExpiration(Duration)
is set to 60s, and the server is responding slowly or the query is not getting picked up by the worker for any reason. The first two RPC calls may time out and be retried, but if the third one completes fast, the overallWorkflowStub#query
call will successfully resolve.
-
setRpcRetryOptions
public WorkflowServiceStubsOptions.Builder setRpcRetryOptions(RpcRetryOptions rpcRetryOptions)
Allows customization of retry options for the outgoing RPC calls to temporal service.Note that default values should be reasonable for most users, be cautious when changing these values as it may result in increased load to the temporal backend or bad network instability tolerance.
Defaults are:
- Retries are limited by the maximum period of 1 minute
- Initial period between retries: 50ms
- Exponential Backoff Coefficient (exponential rate) for the retry period is 2
- See Also:
- Backoff Calculator to get a grasp on an
Exponential Backoff as a retry strategy,
setRpcTimeout(Duration)
,setRpcQueryTimeout(Duration)
-
setQueryRpcTimeout
public WorkflowServiceStubsOptions.Builder setQueryRpcTimeout(java.time.Duration timeout)
Deprecated.Sets the rpc timeout value for query calls. Default is 10 seconds.- Parameters:
timeout
- timeout.
-
build
public WorkflowServiceStubsOptions build()
Builds and returns a ClientOptions object.- Overrides:
build
in classServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>
- Returns:
- ClientOptions object with the specified params.
-
validateAndBuildWithDefaults
public WorkflowServiceStubsOptions validateAndBuildWithDefaults()
- Overrides:
validateAndBuildWithDefaults
in classServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>
-
-