Class ActivateJobsCommandImpl
- All Implemented Interfaces:
ActivateJobsCommandStep1
,ActivateJobsCommandStep1.ActivateJobsCommandStep2
,ActivateJobsCommandStep1.ActivateJobsCommandStep3
,CommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>
,CommandWithTenantStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>
,FinalCommandStep<ActivateJobsResponse>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.api.command.ActivateJobsCommandStep1
ActivateJobsCommandStep1.ActivateJobsCommandStep2, ActivateJobsCommandStep1.ActivateJobsCommandStep3
-
Field Summary
Fields inherited from interface io.camunda.zeebe.client.api.command.CommandWithTenantStep
DEFAULT_TENANT_IDENTIFIER
-
Constructor Summary
ConstructorsConstructorDescriptionActivateJobsCommandImpl
(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration config, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptionfetchVariables
(String... fetchVariables) Set a list of variable names which should be fetch on job activation.fetchVariables
(List<String> fetchVariables) Set a list of variable names which should be fetch on job activation.Set the type of jobs to work on.maxJobsToActivate
(int maxJobsToActivate) Set the maximum of jobs to activate.requestTimeout
(Duration requestTimeout) Sets the request timeout for the command.send()
Sends the command to the Zeebe broker.Specifies the tenant that will own any entities (e.g.Shorthand method forCommandWithOneOrMoreTenantsStep.tenantIds(List)
.Specifies the tenants that may own any entities (e.g.Set the time for how long a job is exclusively assigned for this subscription.workerName
(String workerName) Set the name of the job worker.
-
Constructor Details
-
ActivateJobsCommandImpl
public ActivateJobsCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration config, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
-
Method Details
-
jobType
Description copied from interface:ActivateJobsCommandStep1
Set the type of jobs to work on.- Specified by:
jobType
in interfaceActivateJobsCommandStep1
- Parameters:
jobType
- the type of jobs (e.g. "payment")- Returns:
- the builder for this command
-
maxJobsToActivate
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep2
Set the maximum of jobs to activate. If less jobs are available for activation the command will return a list with fewer jobs.- Specified by:
maxJobsToActivate
in interfaceActivateJobsCommandStep1.ActivateJobsCommandStep2
- Parameters:
maxJobsToActivate
- the maximal number of jobs to activate- Returns:
- the builder for this command
-
timeout
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set the time for how long a job is exclusively assigned for this subscription.In this time, the job can not be assigned by other subscriptions to ensure that only one subscription work on the job. When the time is over then the job can be assigned again by this or other subscription if it's not completed yet.
If no time is set then the default is used from the configuration.
- Specified by:
timeout
in interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3
- Parameters:
timeout
- the time as duration (e.g. "Duration.ofMinutes(5)")- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
workerName
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set the name of the job worker.This name is used to identify the worker which activated the jobs. Its main purpose is for monitoring and auditing. Commands on activated jobs do not check the worker name, i.e. complete or fail job.
If no name is set then the default is used from the configuration.
- Specified by:
workerName
in interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3
- Parameters:
workerName
- the name of the worker (e.g. "payment-service")- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
fetchVariables
public ActivateJobsCommandStep1.ActivateJobsCommandStep3 fetchVariables(List<String> fetchVariables) Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set a list of variable names which should be fetch on job activation.The jobs which are activated by this command will only contain variables from this list.
This can be used to limit the number of variables of the activated jobs.
- Specified by:
fetchVariables
in interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3
- Parameters:
fetchVariables
- list of variables names to fetch on activation- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
fetchVariables
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set a list of variable names which should be fetch on job activation.The jobs which are activated by this command will only contain variables from this list.
This can be used to limit the number of variables of the activated jobs.
- Specified by:
fetchVariables
in interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3
- Parameters:
fetchVariables
- list of variables names to fetch on activation- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
requestTimeout
Description copied from interface:FinalCommandStep
Sets the request timeout for the command. The default request timeout can be configured usingZeebeClientBuilder.defaultRequestTimeout(Duration)
.- Specified by:
requestTimeout
in interfaceFinalCommandStep<ActivateJobsResponse>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStep
Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the future returns the event that was generated by the Zeebe broker in response to the command.Call
ZeebeFuture.join()
to wait until the response is available.Future<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<ActivateJobsResponse>
- Returns:
- a future tracking state of success/failure of the command.
-
tenantId
Description copied from interface:CommandWithOneOrMoreTenantsStep
Specifies the tenant that will own any entities (e.g. process definition, process instances, etc.) resulting from this command, or that owns any entities (e.g. jobs) referred to from this command.Multi-tenancy
Multiple tenants can share a Zeebe cluster. Entities can be assigned to a specific tenant using an identifier. Only that tenant can access these entities.
Any entities created before multi-tenancy has been enabled in the Zeebe cluster, are assigned to the
CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER
.If no tenant is explicitly specified, then the command is rejected.
One or more tenants
This method can be called multiple times to specify multiple tenants.
This can be useful when requesting jobs for multiple tenants at once. Each of the activated jobs will be owned by the tenant that owns the corresponding process instance.
- Specified by:
tenantId
in interfaceCommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>
- Specified by:
tenantId
in interfaceCommandWithTenantStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>
- Parameters:
tenantId
- the identifier of the tenant to specify for this command, e.g."ACME"
- Returns:
- the builder for this command with the tenant specified
-
tenantIds
Description copied from interface:CommandWithOneOrMoreTenantsStep
Specifies the tenants that may own any entities (e.g. process definition, process instances, etc.) resulting from this command.One or more tenants
This can be useful when requesting jobs for multiple tenants at once. Each of the activated jobs will be owned by the tenant that owns the corresponding process instance.
- Specified by:
tenantIds
in interfaceCommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>
- Parameters:
tenantIds
- the identifiers of the tenants to specify for this command, e.g.["ACME", "OTHER"]
- Returns:
- the builder for this command with the tenants specified
- See Also:
-
tenantIds
Description copied from interface:CommandWithOneOrMoreTenantsStep
Shorthand method forCommandWithOneOrMoreTenantsStep.tenantIds(List)
.- Specified by:
tenantIds
in interfaceCommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>
- Parameters:
tenantIds
- the identifiers of the tenants to specify for this command, e.g.["ACME", "OTHER"]
- Returns:
- the builder for this command with the tenants specified
- See Also:
-