Class WorkflowServiceStubsOptions.Builder
- Enclosing class:
WorkflowServiceStubsOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a ClientOptions object.setDisableHealthCheck(boolean disableHealthCheck) Deprecated.setPlugins(WorkflowServiceStubsPlugin... plugins) Sets the workflow service stubs plugins to use for customizing configuration and connection.setQueryRpcTimeout(Duration timeout) Deprecated.setRpcLongPollTimeout(Duration timeout) Sets the rpc timeout value for the following long poll based operations: PollWorkflowTaskQueue, PollActivityTaskQueue, GetWorkflowExecutionHistory.setRpcQueryTimeout(Duration rpcQueryTimeout) Sets the rpc timeout value for query calls.setRpcRetryOptions(RpcRetryOptions rpcRetryOptions) Allows customization of retry options for the outgoing RPC calls to temporal service.setRpcTimeout(Duration timeout) Sets the rpc timeout value for non-query and non-long-poll calls.Validates options and builds with defaults applied.Methods inherited from class io.temporal.serviceclient.ServiceStubsOptions.Builder
addApiKey, addGrpcClientInterceptor, addGrpcMetadataProvider, setChannel, setChannelInitializer, setConnectionBackoffResetFrequency, setEnableHttps, setEnableKeepAlive, setGrpcClientInterceptors, setGrpcCompression, setGrpcMetadataProviders, setGrpcReconnectFrequency, setHeaders, setHealthCheckAttemptTimeout, setHealthCheckTimeout, setKeepAlivePermitWithoutStream, setKeepAliveTime, setKeepAliveTimeout, setMetricsScope, setSslContext, setSystemInfoTimeout, setTarget
-
Method Details
-
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
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#startcall will successfully resolve.- Overrides:
setRpcTimeoutin classServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>- Returns:
this
-
setRpcLongPollTimeout
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
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#querycall will successfully resolve. -
setRpcRetryOptions
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:
-
setPlugins
Sets the workflow service stubs plugins to use for customizing configuration and connection.Plugins that implement both
WorkflowServiceStubsPluginandWorkflowClientPluginwill be automatically propagated to the workflow client.- Parameters:
plugins- the plugins to use- Returns:
- this builder
-
setQueryRpcTimeout
Deprecated.Sets the rpc timeout value for query calls. Default is 10 seconds.- Parameters:
timeout- timeout.
-
build
Builds and returns a ClientOptions object.- Overrides:
buildin classServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>- Returns:
- ClientOptions object with the specified params.
-
validateAndBuildWithDefaults
Validates options and builds with defaults applied.Note: If plugins are configured via
setPlugins(WorkflowServiceStubsPlugin...), they will have an opportunity to modify options after this method is called, when the options are passed toWorkflowServiceStubs.newServiceStubs(WorkflowServiceStubsOptions). This means validation performed here occurs before plugin modifications. In most cases, users should simply callbuild()and let the service stubs creation handle validation.- Overrides:
validateAndBuildWithDefaultsin classServiceStubsOptions.Builder<WorkflowServiceStubsOptions.Builder>- Returns:
- validated options with defaults applied
-
WorkflowServiceStubs.newServiceStubs(WorkflowServiceStubsOptions)that doesn't perform an explicit connection and health check.