Class FailJobCommandImpl
java.lang.Object
io.camunda.zeebe.client.impl.command.CommandWithVariables<FailJobCommandStep1.FailJobCommandStep2>
io.camunda.zeebe.client.impl.command.FailJobCommandImpl
- All Implemented Interfaces:
FailJobCommandStep1
,FailJobCommandStep1.FailJobCommandStep2
,FinalCommandStep<FailJobResponse>
public final class FailJobCommandImpl
extends CommandWithVariables<FailJobCommandStep1.FailJobCommandStep2>
implements FailJobCommandStep1, FailJobCommandStep1.FailJobCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.api.command.FailJobCommandStep1
FailJobCommandStep1.FailJobCommandStep2
-
Field Summary
Fields inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
objectMapper
-
Constructor Summary
ConstructorDescriptionFailJobCommandImpl
(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long key, Duration requestTimeout, Predicate<Throwable> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptionerrorMessage
(String errorMsg) Provide an error message describing the reason for the job failure.requestTimeout
(Duration requestTimeout) Sets the request timeout for the command.retries
(int retries) Set the remaining retries of this job.retryBackoff
(Duration backoffTimeout) Set the backoff timeout for failing this job.send()
Sends the command to the Zeebe broker.setVariablesInternal
(String variables) Methods inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
variables, variables, variables, variables
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.camunda.zeebe.client.api.command.FailJobCommandStep1.FailJobCommandStep2
variables, variables, variables, variables
-
Constructor Details
-
FailJobCommandImpl
public FailJobCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long key, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
-
Method Details
-
retries
Description copied from interface:FailJobCommandStep1
Set the remaining retries of this job.If the retries are greater than zero then this job will be picked up again by a job subscription. Otherwise, an incident is created for this job.
- Specified by:
retries
in interfaceFailJobCommandStep1
- Parameters:
retries
- the remaining retries of this job (e.g. "jobEvent.getRetries() - 1")- Returns:
- the builder for this command. Call
#send()
to complete the command and send it to the broker.
-
retryBackoff
Description copied from interface:FailJobCommandStep1.FailJobCommandStep2
Set the backoff timeout for failing this job.If the backoff timeout is greater than zero and retries are greater than zero then this job will be picked up again after the given backoff timeout is expired.
- Specified by:
retryBackoff
in interfaceFailJobCommandStep1.FailJobCommandStep2
- Parameters:
backoffTimeout
- the backoff timeout of this job- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send * it to the broker.
-
errorMessage
Description copied from interface:FailJobCommandStep1.FailJobCommandStep2
Provide an error message describing the reason for the job failure. If failing the job creates an incident, this error message will be used as incident message.- Specified by:
errorMessage
in interfaceFailJobCommandStep1.FailJobCommandStep2
- Parameters:
errorMsg
- error message to be attached to the failed job- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
setVariablesInternal
- Specified by:
setVariablesInternal
in classCommandWithVariables<FailJobCommandStep1.FailJobCommandStep2>
-
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<FailJobResponse>
- 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<JobEvent> future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<FailJobResponse>
- Returns:
- a future tracking state of success/failure of the command.
-