禁用 Flowable 定时器作业:SpringBoot 项目配置指南
要关闭 Flowable 框架中的 flowable-bpmn-acquire-timer-jobs 作业,可以在 Spring Boot 项目的配置文件中添加以下配置:
flowable:
async-executor-activate: false
通过设置'async-executor-activate' 属性为'false',可以禁用 Flowable 的异步执行器,从而关闭定时器作业的获取和执行。
另外,你也可以使用配置类来配置 Flowable 的异步执行器:
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FlowableConfiguration {
@Bean
public SpringProcessEngineConfiguration springProcessEngineConfiguration() {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setAsyncExecutorActivate(false);
return config;
}
}
通过创建一个配置类,并在其中创建一个'SpringProcessEngineConfiguration' 的 Bean,并设置'asyncExecutorActivate' 属性为'false',即可达到关闭定时器作业的目的。
请注意,以上配置将禁用 Flowable 的所有定时器作业,并且可能会影响到其他 Flowable 功能的正常运行。如果只想关闭特定的定时器作业,可以使用其他方法,如使用 Flowable 的 API 手动停止定时器作业。
原文地址: https://www.cveoy.top/t/topic/qmXo 著作权归作者所有。请勿转载和采集!