Camunda座舱和Rest API下降,但应用程序上升/ JobExecutor配置

时间:2018-11-17 14:10:37

标签: postgresql spring-boot rabbitmq activiti camunda

我们的Camunda Orchestrator面临重大事件。当我们遇到100个正在运行的流程实例时,Camunda Cockpit经历了永恒,并且从不响应。 调用/ app / engine /时,我们有同样的问题。 RabbitMQ消耗的消息很少,然后一切都停止了。

但是该应用程序尚未关闭。 我怀疑流程引擎配置问题,因为无法获取作业执行程序日志。

当我将JobExecutorActivate设置为false时,所有情况都可以正常进行Cockpit和队列使用,但是进程在第一个子进程的末尾停止。

我们有不停的日志循环:

2018/11/17 14:47:33.258 DEBUG ENGINE-14012 Job acquisition thread woke up
2018/11/17 14:47:33.258 DEBUG ENGINE-14022 Acquired 0 jobs for process engine 'default': []
2018/11/17 14:47:33.258 DEBUG ENGINE-14023 Execute jobs for process engine 'default': [8338]
2018/11/17 14:47:33.258 DEBUG ENGINE-14023 Execute jobs for process engine 'default': [8217]
2018/11/17 14:47:33.258 DEBUG ENGINE-14023 Execute jobs for process engine 'default': [8256]
2018/11/17 14:47:33.258 DEBUG ENGINE-14011 Job acquisition thread sleeping for 100 millis
2018/11/17 14:47:33.359 DEBUG ENGINE-14012 Job acquisition thread woke up

此日志也(用于队列消耗):

2018/11/17 15:04:19.582 DEBUG Waiting for message from consumer. {"null":null}
2018/11/17 15:04:19.582 DEBUG Retrieving delivery for Consumer@5d05f453: tags=[{amq.ctag-0ivcbc2QL7g-Duyu2Rcbow=queue_response}], channel=Cached Rabbit Channel: AMQChannel(amqp://guest@127.0.0.1:5672/,4), conn: Proxy@77a5983d Shared Rabbit Connection: SimpleConnection@17a1dd78 [delegate=amqp://guest@127.0.0.1:5672/, localPort= 49812], acknowledgeMode=AUTO local queue size=0 {"null":null}

环境: Spring Boot 2.0.3.RELEASE,Camunda v7.9.0和PostgreSQL,RabbitMQ

Camunda BPM侦听并推送到 165 RabbitMQ队列。

配置:

# Data source (PostgreSql)
com.campDo.fr.camunda.datasource.url=jdbc:postgresql://localhost:5432/campDo
com.campDo.fr.camunda.datasource.username=campDo
com.campDo.fr.camunda.datasource.password=password
com.campDo.fr.camunda.datasource.driver-class-name=org.postgresql.Driver
com.campDo.fr.camunda.bpm.database.jdbc-batch-processing=false
oms.camunda.retry.timer=1
oms.camunda.retry.nb-max=2

SpringProcessEngineConfiguration:

@Bean
    public SpringProcessEngineConfiguration processEngineConfiguration() throws IOException {
        final SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
        config.setDataSource(camundaDataSource);
        config.setDatabaseSchemaUpdate("true");
        config.setTransactionManager(transactionManager());
        config.setHistory("audit");
        config.setJobExecutorActivate(true);
        config.setMetricsEnabled(false);
        final Resource[] resources = resourceLoader.getResources(CLASSPATH_ALL_URL_PREFIX + "/processes/*.bpmn");
        config.setDeploymentResources(resources);

        return config;
    }

Pom依赖项:

 <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
        </dependency>

我非常确定我的工作执行程序配置错误。

更新:

我可以通过将JobExecutorActivate设置为false来启动座舱并使Camunda使用消息,但是进程仍在第一个作业执行者必需的步骤处停止:

config.setJobExecutorActivate(false);

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

首先:如果您的进程包含异步步骤(作业),则它将暂停。激活jobExecutor只会说camunda应该管理这些工作的处理方式。如果禁用执行程序,您的进程将仍然停止,并且由于没有人执行它们,因此它们将保持停止状态。  仅在测试期间或当您有多个节点并且仅其中一些节点应进行处理时,才禁用作业执行。

主要问题:作业执行程序与threadPool配合使用。根据您的描述,池中的所有线程很可能永远阻塞,因此它们永远不会结束也永远不会返回,这意味着您的系统陷于瘫痪。

前一阵子,当我们使用smtp服务器时,连接发生了无限超时,因此尽管计算机不可用,线程仍在等待。

由于camunda的工作执行是高度可靠的,并且本身经过了良好的测试,因此我建议您仔细检查一下代表所做的一切,如果您很幸运(我是对的),您会发现等待的地方永远...