Interface ZeebeClientBuilder

All Known Subinterfaces:
ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4
All Known Implementing Classes:
ZeebeClientBuilderImpl, ZeebeClientCloudBuilderImpl

public interface ZeebeClientBuilder
  • Method Details

    • withProperties

      ZeebeClientBuilder withProperties(Properties properties)
      Sets all the properties from a Properties object. Can be used to configure the client from a properties file.

      See ClientProperties for valid property names.

    • applyEnvironmentVariableOverrides

      ZeebeClientBuilder applyEnvironmentVariableOverrides(boolean applyEnvironmentVariableOverrides)
      Allows to disable the mechanism to override some properties by ENVIRONMENT VARIABLES. This is useful if a client shall be constructed for test cases or in an environment that wants to fully control properties (like Spring Boot).

      The default value is true.

    • gatewayAddress

      ZeebeClientBuilder gatewayAddress(String gatewayAddress)
      Parameters:
      gatewayAddress - the IP socket address of a gateway that the client can initially connect to. Must be in format host:port. The default value is 0.0.0.0:26500 .
    • gatewayRestApiPort

      @ExperimentalApi("https://github.com/camunda/zeebe/issues/16166") ZeebeClientBuilder gatewayRestApiPort(int restApiPort)
      Experimental: This method is under development, and as such using it may have no effect on the client builder when called. Until this warning is removed, anything described below may not yet have taken effect, and the interface and its description are subject to change.
      Parameters:
      restApiPort - the port of the REST API of a gateway that the client can connect to. Default value is 8080.
    • defaultCommunicationApi

      @ExperimentalApi("https://github.com/camunda/zeebe/issues/16166") ZeebeClientBuilder defaultCommunicationApi(String communicationApi)
      Experimental: This method is under development, and as such using it may have no effect on the client builder when called. Until this warning is removed, anything described below may not yet have taken effect, and the interface and its description are subject to change.
      Parameters:
      communicationApi - the communication API to use. It can be one of:
      • REST
      • GRPC
      The default value is CommandWithCommunicationApiStep.DEFAULT_COMMUNICATION_API.
    • defaultTenantId

      ZeebeClientBuilder defaultTenantId(String tenantId)
      Parameters:
      tenantId - the tenant identifier which is used for tenant-aware commands when no tenant identifier is set. The default value is CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER.
    • defaultJobWorkerTenantIds

      ZeebeClientBuilder defaultJobWorkerTenantIds(List<String> tenantIds)
      Parameters:
      tenantIds - the tenant identifiers which are used for job-activation commands when no tenant identifiers are set. The default value contains only CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER.
    • defaultJobWorkerMaxJobsActive

      ZeebeClientBuilder defaultJobWorkerMaxJobsActive(int maxJobsActive)
      Parameters:
      maxJobsActive - Default value for JobWorkerBuilderStep1.JobWorkerBuilderStep3.maxJobsActive(int). Default value is 32.
    • numJobWorkerExecutionThreads

      ZeebeClientBuilder numJobWorkerExecutionThreads(int numThreads)
      Parameters:
      numThreads - The number of threads for invocation of job workers. Setting this value to 0 effectively disables subscriptions and workers. Default value is 1.
    • jobWorkerExecutor

      default ZeebeClientBuilder jobWorkerExecutor(ScheduledExecutorService executor)
      Identical behavior as jobWorkerExecutor(ScheduledExecutorService,boolean), but taking ownership of the executor by default. This means the given executor is closed when the client is closed.
      Parameters:
      executor - an executor service to use when invoking job workers
      See Also:
    • jobWorkerExecutor

      ZeebeClientBuilder jobWorkerExecutor(ScheduledExecutorService executor, boolean takeOwnership)
      Allows passing a custom executor service that will be shared by all job workers created via this client.

      Polling and handling jobs (e.g. via JobHandler will all be invoked on this executor.

      When non-null, this setting override numJobWorkerExecutionThreads(int).

      Parameters:
      executor - an executor service to use when invoking job workers
      takeOwnership - if true, the executor will be closed when the client is closed. otherwise, it's up to the caller to manage its lifecycle
    • defaultJobWorkerName

      ZeebeClientBuilder defaultJobWorkerName(String workerName)
      The name of the worker which is used when none is set for a job worker. Default is 'default'.
    • defaultJobTimeout

      ZeebeClientBuilder defaultJobTimeout(Duration timeout)
      The timeout which is used when none is provided for a job worker. Default is 5 minutes.
    • defaultJobPollInterval

      ZeebeClientBuilder defaultJobPollInterval(Duration pollInterval)
      The interval which a job worker is periodically polling for new jobs. Default is 100 milliseconds.
    • defaultMessageTimeToLive

      ZeebeClientBuilder defaultMessageTimeToLive(Duration timeToLive)
      The time-to-live which is used when none is provided for a message. Default is 1 hour.
    • defaultRequestTimeout

      ZeebeClientBuilder defaultRequestTimeout(Duration requestTimeout)
      The request timeout used if not overridden by the command. Default is 10 seconds.
    • usePlaintext

      ZeebeClientBuilder usePlaintext()
      Use a plaintext connection between the client and the gateway.
    • caCertificatePath

      ZeebeClientBuilder caCertificatePath(String certificatePath)
      Path to a root CA certificate to be used instead of the certificate in the default default store.
    • credentialsProvider

      ZeebeClientBuilder credentialsProvider(CredentialsProvider credentialsProvider)
      A custom CredentialsProvider which will be used to apply authentication credentials to requests.
    • keepAlive

      ZeebeClientBuilder keepAlive(Duration keepAlive)
      Time interval between keep alive messages sent to the gateway. The default is 45 seconds.
    • withInterceptors

      ZeebeClientBuilder withInterceptors(io.grpc.ClientInterceptor... interceptor)
    • withJsonMapper

      ZeebeClientBuilder withJsonMapper(JsonMapper jsonMapper)
    • overrideAuthority

      ZeebeClientBuilder overrideAuthority(String authority)
      Overrides the authority used with TLS virtual hosting. Specifically, to override hostname verification in the TLS handshake. It does not change what host is actually connected to.

      This method is intended for testing, but may safely be used outside of tests as an alternative to DNS overrides.

      This setting does nothing if a plaintext connection is used.

      Parameters:
      authority - The alternative authority to use, commonly in the form host or host:port
    • maxMessageSize

      ZeebeClientBuilder maxMessageSize(int maxSize)
      A custom maxMessageSize allows the client to receive larger or smaller responses from Zeebe. Technically, it specifies the maxInboundMessageSize of the gRPC channel. The default is 4194304 = 4MB.
    • defaultJobWorkerStreamEnabled

      ZeebeClientBuilder defaultJobWorkerStreamEnabled(boolean streamEnabled)
      A custom streamEnabled allows the client to use job stream instead of job poll. The default value is set as enabled.
    • useDefaultRetryPolicy

      ZeebeClientBuilder useDefaultRetryPolicy(boolean useDefaultRetryPolicy)
      If enabled, the client will make use of the default retry policy defined. False by default.

      NOTE: the default retry policy is taken from the gateway-service-config.json in the io.camunda:zeebe-gateway-protocol-impl JAR.

    • build

      ZeebeClient build()
      Returns:
      a new ZeebeClient with the provided configuration options.