Package io.camunda.zeebe.client.impl
Class ZeebeClientCloudBuilderImpl
java.lang.Object
io.camunda.zeebe.client.impl.ZeebeClientCloudBuilderImpl
- All Implemented Interfaces:
ZeebeClientBuilder
,ZeebeClientCloudBuilderStep1
,ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2
,ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3
,ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4
public class ZeebeClientCloudBuilderImpl
extends Object
implements ZeebeClientCloudBuilderStep1, ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2, ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3, ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.ZeebeClientCloudBuilderStep1
ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2
ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3
ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyEnvironmentVariableOverrides
(boolean applyEnvironmentVariableOverrides) Allows to disable the mechanism to override some properties by ENVIRONMENT VARIABLES.build()
caCertificatePath
(String certificatePath) Path to a root CA certificate to be used instead of the certificate in the default default store.credentialsProvider
(CredentialsProvider credentialsProvider) A customCredentialsProvider
which will be used to apply authentication credentials to requests.defaultJobPollInterval
(Duration pollInterval) The interval which a job worker is periodically polling for new jobs.defaultJobTimeout
(Duration timeout) The timeout which is used when none is provided for a job worker.defaultJobWorkerMaxJobsActive
(int maxJobsActive) defaultJobWorkerName
(String workerName) The name of the worker which is used when none is set for a job worker.defaultJobWorkerStreamEnabled
(boolean streamEnabled) A custom streamEnabled allows the client to use job stream instead of job poll.defaultJobWorkerTenantIds
(List<String> tenantIds) defaultMessageTimeToLive
(Duration timeToLive) The time-to-live which is used when none is provided for a message.defaultRequestTimeout
(Duration requestTimeout) The request timeout used if not overridden by the command.defaultTenantId
(String tenantId) gatewayAddress
(String gatewayAddress) grpcAddress
(URI grpcAddress) jobWorkerExecutor
(ScheduledExecutorService executor, boolean takeOwnership) Allows passing a custom executor service that will be shared by all job workers created via this client.Time interval between keep alive messages sent to the gateway.maxMessageSize
(int maxMessageSize) A custom maxMessageSize allows the client to receive larger or smaller responses from Zeebe.maxMetadataSize
(int maxMetadataSize) A custom maxMetadataSize allows the client to receive larger or smaller response headers from Zeebe.numJobWorkerExecutionThreads
(int numThreads) overrideAuthority
(String authority) Overrides the authority used with TLS virtual hosting.preferRestOverGrpc
(boolean preferRestOverGrpc) If true, will prefer to use REST over gRPC for calls which can be done over both REST and gRPC.restAddress
(URI restAddress) toString()
useDefaultRetryPolicy
(boolean useDefaultRetryPolicy) If enabled, the client will make use of the default retry policy defined.Use a plaintext connection between the client and the gateway.withChainHandlers
(org.apache.hc.client5.http.async.AsyncExecChainHandler... chainHandler) Custom implementations of the Apache HttpClientAsyncExecChainHandler
middleware API.withClientId
(String clientId) Sets the client id that will be used to authenticate against the Camunda Cloud cluster.withClientSecret
(String clientSecret) Sets the client secret that will be used to authenticate against the Camunda Cloud cluster.withClusterId
(String clusterId) Sets the cluster id of the Camunda Cloud cluster.withInterceptors
(io.grpc.ClientInterceptor... interceptor) Custom implementations of the gRPCClientInterceptor
middleware API.withJsonMapper
(JsonMapper jsonMapper) withProperties
(Properties properties) Sets all the properties from aProperties
object.withRegion
(String region) Sets the region of the Camunda Cloud cluster.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.camunda.zeebe.client.ZeebeClientBuilder
jobWorkerExecutor
-
Constructor Details
-
ZeebeClientCloudBuilderImpl
public ZeebeClientCloudBuilderImpl()
-
-
Method Details
-
withClusterId
Description copied from interface:ZeebeClientCloudBuilderStep1
Sets the cluster id of the Camunda Cloud cluster. This parameter is mandatory.- Specified by:
withClusterId
in interfaceZeebeClientCloudBuilderStep1
- Parameters:
clusterId
- cluster id of the Camunda Cloud cluster.
-
withClientId
public ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3 withClientId(String clientId) Description copied from interface:ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2
Sets the client id that will be used to authenticate against the Camunda Cloud cluster. This parameter is mandatory.- Specified by:
withClientId
in interfaceZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2
- Parameters:
clientId
- client id that will be used in the authentication.
-
withClientSecret
public ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4 withClientSecret(String clientSecret) Description copied from interface:ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3
Sets the client secret that will be used to authenticate against the Camunda Cloud cluster. This parameter is mandatory.- Specified by:
withClientSecret
in interfaceZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3
- Parameters:
clientSecret
- client secret that will be used in the authentication.
-
withRegion
public ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4 withRegion(String region) Description copied from interface:ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4
Sets the region of the Camunda Cloud cluster. Default is 'bru-2'.- Specified by:
withRegion
in interfaceZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4
- Parameters:
region
- region of the Camunda Cloud cluster
-
withProperties
Description copied from interface:ZeebeClientBuilder
Sets all the properties from aProperties
object. Can be used to configure the client from a properties file.See
ClientProperties
for valid property names.- Specified by:
withProperties
in interfaceZeebeClientBuilder
-
applyEnvironmentVariableOverrides
public ZeebeClientBuilder applyEnvironmentVariableOverrides(boolean applyEnvironmentVariableOverrides) Description copied from interface:ZeebeClientBuilder
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
.- Specified by:
applyEnvironmentVariableOverrides
in interfaceZeebeClientBuilder
-
gatewayAddress
- Specified by:
gatewayAddress
in interfaceZeebeClientBuilder
- Parameters:
gatewayAddress
- the IP socket address of a gateway that the client can initially connect to. Must be in formathost:port
. The default value is0.0.0.0:26500
.
-
restAddress
- Specified by:
restAddress
in interfaceZeebeClientBuilder
- Parameters:
restAddress
- the REST API address of a gateway that the client can connect to. The default value is0.0.0.0:8080
.
-
grpcAddress
- Specified by:
grpcAddress
in interfaceZeebeClientBuilder
- Parameters:
grpcAddress
- the gRPC address of a gateway that the client can connect to. The default value is0.0.0.0:26500
.
-
defaultTenantId
@ExperimentalApi("https://github.com/camunda/camunda/issues/14106") public ZeebeClientBuilder defaultTenantId(String tenantId) - Specified by:
defaultTenantId
in interfaceZeebeClientBuilder
- Parameters:
tenantId
- the tenant identifier which is used for tenant-aware commands when no tenant identifier is set. The default value isCommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER
.
-
defaultJobWorkerTenantIds
@ExperimentalApi("https://github.com/camunda/camunda/issues/14106") public ZeebeClientBuilder defaultJobWorkerTenantIds(List<String> tenantIds) - Specified by:
defaultJobWorkerTenantIds
in interfaceZeebeClientBuilder
- Parameters:
tenantIds
- the tenant identifiers which are used for job-activation commands when no tenant identifiers are set. The default value contains onlyCommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER
.
-
defaultJobWorkerMaxJobsActive
- Specified by:
defaultJobWorkerMaxJobsActive
in interfaceZeebeClientBuilder
- Parameters:
maxJobsActive
- Default value forJobWorkerBuilderStep1.JobWorkerBuilderStep3.maxJobsActive(int)
. Default value is 32.
-
numJobWorkerExecutionThreads
- Specified by:
numJobWorkerExecutionThreads
in interfaceZeebeClientBuilder
- 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
public ZeebeClientBuilder jobWorkerExecutor(ScheduledExecutorService executor, boolean takeOwnership) Description copied from interface:ZeebeClientBuilder
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
ZeebeClientBuilder.numJobWorkerExecutionThreads(int)
.- Specified by:
jobWorkerExecutor
in interfaceZeebeClientBuilder
- Parameters:
executor
- an executor service to use when invoking job workerstakeOwnership
- if true, the executor will be closed when the client is closed. otherwise, it's up to the caller to manage its lifecycle
-
defaultJobWorkerName
Description copied from interface:ZeebeClientBuilder
The name of the worker which is used when none is set for a job worker. Default is 'default'.- Specified by:
defaultJobWorkerName
in interfaceZeebeClientBuilder
-
defaultJobTimeout
Description copied from interface:ZeebeClientBuilder
The timeout which is used when none is provided for a job worker. Default is 5 minutes.- Specified by:
defaultJobTimeout
in interfaceZeebeClientBuilder
-
defaultJobPollInterval
Description copied from interface:ZeebeClientBuilder
The interval which a job worker is periodically polling for new jobs. Default is 100 milliseconds.- Specified by:
defaultJobPollInterval
in interfaceZeebeClientBuilder
-
defaultMessageTimeToLive
Description copied from interface:ZeebeClientBuilder
The time-to-live which is used when none is provided for a message. Default is 1 hour.- Specified by:
defaultMessageTimeToLive
in interfaceZeebeClientBuilder
-
defaultRequestTimeout
Description copied from interface:ZeebeClientBuilder
The request timeout used if not overridden by the command. Default is 10 seconds.- Specified by:
defaultRequestTimeout
in interfaceZeebeClientBuilder
-
usePlaintext
Description copied from interface:ZeebeClientBuilder
Use a plaintext connection between the client and the gateway.- Specified by:
usePlaintext
in interfaceZeebeClientBuilder
-
caCertificatePath
Description copied from interface:ZeebeClientBuilder
Path to a root CA certificate to be used instead of the certificate in the default default store.- Specified by:
caCertificatePath
in interfaceZeebeClientBuilder
-
credentialsProvider
Description copied from interface:ZeebeClientBuilder
A customCredentialsProvider
which will be used to apply authentication credentials to requests.- Specified by:
credentialsProvider
in interfaceZeebeClientBuilder
-
keepAlive
Description copied from interface:ZeebeClientBuilder
Time interval between keep alive messages sent to the gateway. The default is 45 seconds.- Specified by:
keepAlive
in interfaceZeebeClientBuilder
-
withInterceptors
Description copied from interface:ZeebeClientBuilder
Custom implementations of the gRPCClientInterceptor
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/'}.- Specified by:
withInterceptors
in interfaceZeebeClientBuilder
-
withChainHandlers
public ZeebeClientCloudBuilderStep1.ZeebeClientCloudBuilderStep2.ZeebeClientCloudBuilderStep3.ZeebeClientCloudBuilderStep4 withChainHandlers(org.apache.hc.client5.http.async.AsyncExecChainHandler... chainHandler) Description copied from interface:ZeebeClientBuilder
Custom implementations of the Apache HttpClientAsyncExecChainHandler
middleware API. The middleware implementations will be called on every REST API call that the client makes.- Specified by:
withChainHandlers
in interfaceZeebeClientBuilder
-
withJsonMapper
- Specified by:
withJsonMapper
in interfaceZeebeClientBuilder
-
overrideAuthority
Description copied from interface:ZeebeClientBuilder
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.- Specified by:
overrideAuthority
in interfaceZeebeClientBuilder
- Parameters:
authority
- The alternative authority to use, commonly in the formhost
orhost:port
-
maxMessageSize
Description copied from interface:ZeebeClientBuilder
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.- Specified by:
maxMessageSize
in interfaceZeebeClientBuilder
-
maxMetadataSize
Description copied from interface:ZeebeClientBuilder
A custom maxMetadataSize allows the client to receive larger or smaller response headers from Zeebe. Technically, it specifies the maxInboundMetadataSize of the gRPC channel. The default is 16384 = 16KB .- Specified by:
maxMetadataSize
in interfaceZeebeClientBuilder
-
defaultJobWorkerStreamEnabled
Description copied from interface:ZeebeClientBuilder
A custom streamEnabled allows the client to use job stream instead of job poll. The default value is set as enabled.- Specified by:
defaultJobWorkerStreamEnabled
in interfaceZeebeClientBuilder
-
useDefaultRetryPolicy
Description copied from interface:ZeebeClientBuilder
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 theio.camunda:zeebe-gateway-protocol-impl
JAR.- Specified by:
useDefaultRetryPolicy
in interfaceZeebeClientBuilder
-
preferRestOverGrpc
Description copied from interface:ZeebeClientBuilder
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.
- Specified by:
preferRestOverGrpc
in interfaceZeebeClientBuilder
- Parameters:
preferRestOverGrpc
- if true, the client will use REST instead of gRPC whenever possible- Returns:
- this builder for chaining
-
build
- Specified by:
build
in interfaceZeebeClientBuilder
- Returns:
- a new
ZeebeClient
with the provided configuration options.
-
toString
-