Package io.zeebe.client.api.worker
Interface JobWorkerBuilderStep1.JobWorkerBuilderStep2
-
- All Known Implementing Classes:
JobWorkerBuilderImpl
- Enclosing interface:
- JobWorkerBuilderStep1
public static interface JobWorkerBuilderStep1.JobWorkerBuilderStep2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JobWorkerBuilderStep1.JobWorkerBuilderStep3
handler(JobHandler handler)
Set the handler to process the jobs.
-
-
-
Method Detail
-
handler
JobWorkerBuilderStep1.JobWorkerBuilderStep3 handler(JobHandler handler)
Set the handler to process the jobs. At the end of the processing, the handler should complete the job or mark it as failed;Example JobHandler implementation:
public final class PaymentHandler implements JobHandler { @Override public void handle(JobClient client, JobEvent jobEvent) { String json = jobEvent.getVariables(); // modify variables client .newCompleteCommand(jobEvent.getKey()) .variables(json) .send(); } };
The handler must be thread-safe.- Parameters:
handler
- the handle to process the jobs- Returns:
- the builder for this worker
-
-