Class WorkflowClientOptions.Builder
- Enclosing class:
WorkflowClientOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuild()setBinaryChecksum(String binaryChecksum) Deprecated.setContextPropagators(List<ContextPropagator> contextPropagators) setDataConverter(DataConverter dataConverter) Overrides a data converter implementation used serialize workflow and activity arguments and results.setDisableWorkerEnvironmentInfo(boolean disableWorkerEnvironmentInfo) Disables reporting the JVM version, detected hosting environments (Docker, Kubernetes, cloud platforms), and OS platform in worker heartbeats.setExternalStorage(ExternalStorage externalStorage) External storage configuration used to store/retrieve large payloads.setIdentity(String identity) Override human readable identity of the worker.setInterceptors(WorkflowClientInterceptor... interceptors) Interceptor used to intercept workflow client calls.setNamespace(String namespace) setPlugins(WorkflowClientPlugin... plugins) Sets the workflow client plugins to use with this client.setQueryRejectCondition(io.temporal.api.enums.v1.QueryRejectCondition queryRejectCondition) Should a query be rejected by closed and failed workflows.setWorkerHeartbeatInterval(Duration workerHeartbeatInterval) Sets the interval at which workers send heartbeat RPCs to the server.Validates options and builds with defaults applied.
-
Method Details
-
setNamespace
-
setDataConverter
Overrides a data converter implementation used serialize workflow and activity arguments and results.Default is
DataConverter.getDefaultInstance(). -
setExternalStorage
@Experimental public WorkflowClientOptions.Builder setExternalStorage(@Nullable ExternalStorage externalStorage) External storage configuration used to store/retrieve large payloads.n.b. This is currently a no-op. External storage has not been fully integrated yet.
Defaults to null.
-
setInterceptors
Interceptor used to intercept workflow client calls.- Parameters:
interceptors- not null
-
setIdentity
Override human readable identity of the worker. Identity is used to identify a worker and is recorded in the workflow history events. For example when a worker gets an activity task the correspondent ActivityTaskStarted event contains the worker identity as a field. Default is whatever(ManagementFactory.getRuntimeMXBean().getName()returns. -
setBinaryChecksum
Deprecated.useWorkerOptions.Builder.setBuildId(String)instead.Sets worker binary checksum, which gets propagated in all history events and can be used for auto-reset assuming that every build has a new unique binary checksum. Can be null. -
setContextPropagators
public WorkflowClientOptions.Builder setContextPropagators(List<ContextPropagator> contextPropagators) - Parameters:
contextPropagators- specifies the list of context propagators to use with the client.
-
setQueryRejectCondition
public WorkflowClientOptions.Builder setQueryRejectCondition(io.temporal.api.enums.v1.QueryRejectCondition queryRejectCondition) Should a query be rejected by closed and failed workflows.Default is
QueryRejectCondition.QUERY_REJECT_CONDITION_UNSPECIFIEDwhich means that closed and failed workflows are still queryable. -
setPlugins
Sets the workflow client plugins to use with this client. Plugins can modify client configuration.Plugins that also implement
WorkerPluginare automatically propagated to workers created from this client.- Parameters:
plugins- the workflow client plugins to use- Returns:
- this builder for chaining
- See Also:
-
setWorkerHeartbeatInterval
@Experimental public WorkflowClientOptions.Builder setWorkerHeartbeatInterval(Duration workerHeartbeatInterval) Sets the interval at which workers send heartbeat RPCs to the server. If not set or set to zero, defaults to 60 seconds. A negative duration disables heartbeating. Positive values must be between 1 and 60 seconds inclusive.- Parameters:
workerHeartbeatInterval- the heartbeat interval, or a negative duration to disable
-
setDisableWorkerEnvironmentInfo
@Experimental public WorkflowClientOptions.Builder setDisableWorkerEnvironmentInfo(boolean disableWorkerEnvironmentInfo) Disables reporting the JVM version, detected hosting environments (Docker, Kubernetes, cloud platforms), and OS platform in worker heartbeats. This information is sent once per worker, with the first heartbeat accepted by the server.- Parameters:
disableWorkerEnvironmentInfo- true to omit environment information from heartbeats
-
build
-
validateAndBuildWithDefaults
Validates options and builds with defaults applied.Note: If plugins are configured via
setPlugins(WorkflowClientPlugin...), they will have an opportunity to modify options after this method is called, when the options are passed toWorkflowClient.newInstance(io.temporal.serviceclient.WorkflowServiceStubs). This means validation performed here occurs before plugin modifications. In most cases, users should simply callbuild()and let the client creation handle validation.- Returns:
- validated options with defaults applied
-
WorkerOptions.Builder.setBuildId(String)instead.