Interface CamundaClientBuilder

All Known Subinterfaces:
CamundaClientCloudBuilderStep1.CamundaClientCloudBuilderStep2.CamundaClientCloudBuilderStep3.CamundaClientCloudBuilderStep4
All Known Implementing Classes:
CamundaClientBuilderImpl, CamundaClientCloudBuilderImpl

public interface CamundaClientBuilder
  • Method Details

    • withProperties

      CamundaClientBuilder 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

      CamundaClientBuilder 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

      @Deprecated CamundaClientBuilder gatewayAddress(String gatewayAddress)
      Deprecated.
      since 8.5 for removal with 8.8, replaced by grpcAddress(URI)
      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 .
    • restAddress

      CamundaClientBuilder restAddress(URI restAddress)
      Parameters:
      restAddress - the REST API address of a gateway that the client can connect to. The address must be an absolute URL, including the scheme.

      The default value is https://0.0.0.0:8080.

    • grpcAddress

      CamundaClientBuilder grpcAddress(URI grpcAddress)
      Parameters:
      grpcAddress - the gRPC address of a gateway that the client can connect to. The address must be an absolute URL, including the scheme.

      The default value is https://0.0.0.0:26500.

    • defaultTenantId

      CamundaClientBuilder 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

      CamundaClientBuilder 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

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

      CamundaClientBuilder 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 CamundaClientBuilder 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

      CamundaClientBuilder 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

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

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

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

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

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

      CamundaClientBuilder defaultRequestTimeoutOffset(Duration requestTimeoutOffset)
      The request timeout client offset is used in commands where the defaultRequestTimeout(Duration) is also passed to the server. This ensures that the client timeout does not occur before the server timeout.

      The client-side timeout for these commands is calculated as the sum of defaultRequestTimeout and defaultRequestTimeoutOffset.

      Default is 1 second.

    • usePlaintext

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

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

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

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

      CamundaClientBuilder withInterceptors(io.grpc.ClientInterceptor... interceptor)
      Custom implementations of the gRPC ClientInterceptor middleware API. The interceptors will be applied to every gRPC call that the client makes. More details can be found at invalid input: '{@link https://grpc.io/docs/guides/interceptors/'}.
    • withChainHandlers

      CamundaClientBuilder withChainHandlers(org.apache.hc.client5.http.async.AsyncExecChainHandler... chainHandler)
      Custom implementations of the Apache HttpClient AsyncExecChainHandler middleware API. The middleware implementations will be called on every REST API call that the client makes.
    • withJsonMapper

      CamundaClientBuilder withJsonMapper(JsonMapper jsonMapper)
    • overrideAuthority

      CamundaClientBuilder 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

      CamundaClientBuilder maxMessageSize(int maxSize)
      A custom maxMessageSize allows the client to receive larger or smaller responses from Camunda. Technically, it specifies the maxInboundMessageSize of the gRPC channel. The default is 5242880 = 5MB.
    • maxMetadataSize

      CamundaClientBuilder maxMetadataSize(int maxSize)
      A custom maxMetadataSize allows the client to receive larger or smaller response headers from Camunda. Technically, it specifies the maxInboundMetadataSize of the gRPC channel. The default is 16384 = 16KB .
    • defaultJobWorkerStreamEnabled

      CamundaClientBuilder 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

      CamundaClientBuilder 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.

    • preferRestOverGrpc

      @ExperimentalApi("https://github.com/camunda/camunda/issues/16166") @Deprecated CamundaClientBuilder preferRestOverGrpc(boolean preferRestOverGrpc)
      Deprecated.
      since 8.5, will be removed in 8.8
      If true, will prefer to use REST over gRPC for calls which can be done over both REST and gRPC. This is an experimental API which is present while we migrate the bulk of the API from gRPC to REST. Once done, this will also be removed.

      NOTE: not all calls can be done over REST (or HTTP/1) yet, this is also subject to change.

      Parameters:
      preferRestOverGrpc - if true, the client will use REST instead of gRPC whenever possible
      Returns:
      this builder for chaining
    • build

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