Annotation Interface JobWorker
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIf set to true, the job is automatically completed after the worker code has finished.booleanIf set to true, the worker will actually be subscribing.booleanIf set to true, all variables are fetchedString[]Set a list of variable names which should be fetched on job activation.intSet the maximum number of jobs which will be exclusively activated for this worker at the same time.intSet the max number of retries for a jobset to empty string which leads to default from CamundaClientBuilderImpl being used inJobWorkerAnnotationProcessorlongSet the maximal interval (in milliseconds) between polling for new jobs.longSet the request timeout (in seconds) for activate job request used to poll for new jobs.booleanWhether job streaming should be enabled for this job type.longStream timeout in msString[]A list of tenants for this job will be worked on.longSet the time (in milliseconds) for how long a job is exclusively assigned for this worker.Set to empty string which leads to the method name being used (if not ${camunda.client.worker.defaults.type} is configured) Implemented inJobWorkerAnnotationProcessor
-
Element Details
-
type
String typeSet to empty string which leads to the method name being used (if not ${camunda.client.worker.defaults.type} is configured) Implemented inJobWorkerAnnotationProcessor- Default:
""
-
name
String nameset to empty string which leads to default from CamundaClientBuilderImpl being used inJobWorkerAnnotationProcessor- Default:
""
-
timeout
long timeoutSet the time (in milliseconds) for how long a job is exclusively assigned for this worker. During this time, the job cannot be assigned by other workers to ensure that only one worker works 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 theCamundaClientConfiguration- Default:
-1L
-
maxJobsActive
int maxJobsActiveSet the maximum number of jobs which will be exclusively activated for this worker at the same time. This is used to control the backpressure of the worker. When the maximum is reached, then the worker will stop activating new jobs to not overwhelm the client and give other workers the chance to work on the jobs. The worker will try to activate new jobs again when jobs are completed (or marked as failed). If no maximum is set, then the default from theCamundaClientConfiguration, is used.
Considerations: A greater value can avoid situations in which the client waits idle for the broker to provide more jobs. This can improve the worker's throughput. The memory used by the worker is linear with respect to this value. The job's timeout starts to run down as soon as the broker pushes the job. Keep in mind that the following must hold to ensure fluent job handling:time spent in queue + time job handler needs until job completion invalid input: '<' job timeout- Default:
-1
-
requestTimeout
long requestTimeoutSet the request timeout (in seconds) for activate job request used to poll for new jobs. If no request timeout is set then the default is used from theCamundaClientConfiguration- Default:
-1L
-
pollInterval
long pollIntervalSet the maximal interval (in milliseconds) between polling for new jobs. 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 theCamundaClientConfiguration- Default:
-1L
-
fetchVariables
String[] fetchVariablesSet a list of variable names which should be fetched on job activation. The jobs which are activated by this worker will only contain variables from this list. This can be used to limit the number of variables of the activated jobs.- Default:
{}
-
fetchAllVariables
boolean fetchAllVariablesIf set to true, all variables are fetched- Default:
false
-
autoComplete
boolean autoCompleteIf set to true, the job is automatically completed after the worker code has finished. In this case, your worker code is not allowed to complete the job itself.You can still throw exceptions if you want to raise a problem instead of job completion. To control the retry behavior or submit variables, you can use the
JobError. You could also raise a BPMN error throwing aBpmnError- Default:
true
-
enabled
boolean enabledIf set to true, the worker will actually be subscribing.- Default:
true
-
tenantIds
String[] tenantIdsA list of tenants for this job will be worked on.- Default:
{}
-
streamEnabled
boolean streamEnabledWhether job streaming should be enabled for this job type. Useful in high-performance setups but can only be used with a gRPC connection.- Default:
false
-
streamTimeout
long streamTimeoutStream timeout in ms- Default:
3600000L
-
maxRetries
int maxRetriesSet the max number of retries for a job- Default:
-1
-