public static interface JobWorkerBuilderStep1.JobWorkerBuilderStep3
Modifier and Type | Method and Description |
---|---|
JobWorkerBuilderStep1.JobWorkerBuilderStep3 |
bufferSize(int numberOfJobs)
Set the maximum number of jobs which will be exclusively assigned to this worker at the same
time.
|
JobWorkerBuilderStep1.JobWorkerBuilderStep3 |
name(String workerName)
Set the name of the worker owner.
|
JobWorker |
open()
Open the worker and start to work on available tasks.
|
JobWorkerBuilderStep1.JobWorkerBuilderStep3 |
pollInterval(java.time.Duration pollInterval)
Set the maximal interval between polling for new jobs.
|
JobWorkerBuilderStep1.JobWorkerBuilderStep3 |
timeout(java.time.Duration timeout)
Set the time for how long a job is exclusively assigned for this worker.
|
JobWorkerBuilderStep1.JobWorkerBuilderStep3 |
timeout(long timeout)
Set the time for how long a job is exclusively assigned for this worker.
|
JobWorkerBuilderStep1.JobWorkerBuilderStep3 timeout(long timeout)
In this time, the job can not be assigned by other workers to ensure that only one worker work on the job. When the time is over then the job can be assigned again by this or other worker if it's not completed yet.
If no timeout is set, then the default is used from the configuration.
timeout
- the time in millisecondsJobWorkerBuilderStep1.JobWorkerBuilderStep3 timeout(java.time.Duration timeout)
In this time, the job can not be assigned by other workers to ensure that only one worker work on the job. When the time is over then the job can be assigned again by this or other worker if it's not completed yet.
If no time is set then the default is used from the configuration.
timeout
- the time as duration (e.g. "Duration.ofMinutes(5)")JobWorkerBuilderStep1.JobWorkerBuilderStep3 name(String workerName)
This name is used to identify the worker to which a job is exclusively assigned to.
If no name is set then the default is used from the configuration.
workerName
- the name of the worker (e.g. "payment-service")JobWorkerBuilderStep1.JobWorkerBuilderStep3 bufferSize(int numberOfJobs)
This is used to control the backpressure of the worker. When the number of assigned jobs is reached then the broker will stop assigning new jobs to the worker in order to to not overwhelm the client and give other workers the chance to work on the jobs. The broker will assign new jobs again when jobs are completed (or marked as failed) which were assigned to the worker.
If no buffer size is set then the default is used from the ZeebeClientConfiguration
.
Considerations:
time spent in buffer + time job handler needs until job completion < job timeout
.numberOfJobs
- the number of assigned jobsJobWorkerBuilderStep1.JobWorkerBuilderStep3 pollInterval(java.time.Duration pollInterval)
A job worker will automatically try to always activate new jobs after completing jobs. If no jobs can be activated after completing the worker will periodically poll for new jobs.
If no poll interval is set then the default is used from the ZeebeClientConfiguration
pollInterval
- the maximal interval to check for new jobsJobWorker open()
Copyright © 2017–2018 camunda services GmbH. All rights reserved.