org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor Java Examples
The following examples show how to use
org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultJobConfiguration.java From camunda-bpm-spring-boot-starter with Apache License 2.0 | 6 votes |
@Bean @ConditionalOnMissingBean(JobExecutor.class) @ConditionalOnProperty(prefix = "camunda.bpm.job-execution", name = "enabled", havingValue = "true", matchIfMissing = true) public static JobExecutor jobExecutor(@Qualifier(CAMUNDA_TASK_EXECUTOR_QUALIFIER) final TaskExecutor taskExecutor, CamundaBpmProperties properties) { final SpringJobExecutor springJobExecutor = new SpringJobExecutor(); springJobExecutor.setTaskExecutor(taskExecutor); springJobExecutor.setRejectedJobsHandler(new CallerRunsRejectedJobsHandler()); JobExecutionProperty jobExecution = properties.getJobExecution(); Optional.ofNullable(jobExecution.getLockTimeInMillis()).ifPresent(springJobExecutor::setLockTimeInMillis); Optional.ofNullable(jobExecution.getMaxJobsPerAcquisition()).ifPresent(springJobExecutor::setMaxJobsPerAcquisition); Optional.ofNullable(jobExecution.getWaitTimeInMillis()).ifPresent(springJobExecutor::setWaitTimeInMillis); Optional.ofNullable(jobExecution.getMaxWait()).ifPresent(springJobExecutor::setMaxWait); Optional.ofNullable(jobExecution.getBackoffTimeInMillis()).ifPresent(springJobExecutor::setBackoffTimeInMillis); Optional.ofNullable(jobExecution.getMaxBackoff()).ifPresent(springJobExecutor::setMaxBackoff); Optional.ofNullable(jobExecution.getBackoffDecreaseThreshold()).ifPresent(springJobExecutor::setBackoffDecreaseThreshold); Optional.ofNullable(jobExecution.getWaitIncreaseFactor()).ifPresent(springJobExecutor::setWaitIncreaseFactor); return springJobExecutor; }
Example #2
Source File: DefaultJobConfiguration.java From camunda-bpm-platform with Apache License 2.0 | 6 votes |
@Bean @ConditionalOnMissingBean(JobExecutor.class) @ConditionalOnProperty(prefix = "camunda.bpm.job-execution", name = "enabled", havingValue = "true", matchIfMissing = true) public static JobExecutor jobExecutor(@Qualifier(CAMUNDA_TASK_EXECUTOR_QUALIFIER) final TaskExecutor taskExecutor, CamundaBpmProperties properties) { final SpringJobExecutor springJobExecutor = new SpringJobExecutor(); springJobExecutor.setTaskExecutor(taskExecutor); springJobExecutor.setRejectedJobsHandler(new NotifyAcquisitionRejectedJobsHandler()); JobExecutionProperty jobExecution = properties.getJobExecution(); Optional.ofNullable(jobExecution.getLockTimeInMillis()).ifPresent(springJobExecutor::setLockTimeInMillis); Optional.ofNullable(jobExecution.getMaxJobsPerAcquisition()).ifPresent(springJobExecutor::setMaxJobsPerAcquisition); Optional.ofNullable(jobExecution.getWaitTimeInMillis()).ifPresent(springJobExecutor::setWaitTimeInMillis); Optional.ofNullable(jobExecution.getMaxWait()).ifPresent(springJobExecutor::setMaxWait); Optional.ofNullable(jobExecution.getBackoffTimeInMillis()).ifPresent(springJobExecutor::setBackoffTimeInMillis); Optional.ofNullable(jobExecution.getMaxBackoff()).ifPresent(springJobExecutor::setMaxBackoff); Optional.ofNullable(jobExecution.getBackoffDecreaseThreshold()).ifPresent(springJobExecutor::setBackoffDecreaseThreshold); Optional.ofNullable(jobExecution.getWaitIncreaseFactor()).ifPresent(springJobExecutor::setWaitIncreaseFactor); return springJobExecutor; }
Example #3
Source File: CamundaJobExecutorConfiguration.java From flowing-retail with Apache License 2.0 | 5 votes |
public static JobExecutor jobExecutor(@Qualifier(JobConfiguration.CAMUNDA_TASK_EXECUTOR_QUALIFIER) final TaskExecutor taskExecutor) { final SpringJobExecutor springJobExecutor = new SpringJobExecutor(); springJobExecutor.setTaskExecutor(taskExecutor); springJobExecutor.setRejectedJobsHandler(new CallerRunsRejectedJobsHandler()); springJobExecutor.setWaitTimeInMillis(10); // springJobExecutor.setWaitIncreaseFactor(1.0f); springJobExecutor.setMaxWait(20); return springJobExecutor; }