Class WorkflowClientOptions.Builder

java.lang.Object
io.temporal.client.WorkflowClientOptions.Builder
Enclosing class:
WorkflowClientOptions

public static final class WorkflowClientOptions.Builder extends Object
  • Method Details

    • setNamespace

      public WorkflowClientOptions.Builder setNamespace(String namespace)
    • setDataConverter

      public WorkflowClientOptions.Builder setDataConverter(DataConverter dataConverter)
      Overrides a data converter implementation used serialize workflow and activity arguments and results.

      Default is DataConverter.getDefaultInstance().

    • setInterceptors

      public WorkflowClientOptions.Builder setInterceptors(WorkflowClientInterceptor... interceptors)
      Interceptor used to intercept workflow client calls.
      Parameters:
      interceptors - not null
    • setIdentity

      public WorkflowClientOptions.Builder setIdentity(String identity)
      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 public WorkflowClientOptions.Builder setBinaryChecksum(String binaryChecksum)
      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_UNSPECIFIED which 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 WorkerPlugin are 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
    • build

      public WorkflowClientOptions build()
    • validateAndBuildWithDefaults

      public WorkflowClientOptions 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 to WorkflowClient.newInstance(io.temporal.serviceclient.WorkflowServiceStubs). This means validation performed here occurs before plugin modifications. In most cases, users should simply call build() and let the client creation handle validation.

      Returns:
      validated options with defaults applied