简体   繁体   English

Camunda 数据并发问题

[英]Camunda Data Concurrency Issue

I'm facing Camunda concurrency issues while performing the concurrent operation.我在执行并发操作时面临 Camunda 并发问题。 In case of multiple requests, when we are setting variables of one service task having multiple instances and in another service task, we are getting partial data.在多个请求的情况下,当我们设置一个具有多个实例的服务任务的变量时,而在另一个服务任务中,我们得到的是部分数据。 But while requesting one at a time isn't causing any issue while getting Camund variable in any service task.但是,在任何服务任务中获取 Camund 变量时,一次请求一个不会导致任何问题。

This below is our use case: We are using rabbitMQ for messaging.下面是我们的用例:我们使用rabbitMQ 进行消息传递。

1. Message Received: Consume the messages from the queue and setting all the variables of Camunda while starting the Process Engine. 1. 接收到的消息在启动流程引擎的同时,从队列中消费消息并设置 Camunda 的所有变量。

Note : Concurrency of rabbitMQ consumer is 5.注意rabbitMQ 消费者并发为5。

2. Task 1: This service task is not getting all variables when we produce multiple requests to the rabbitMQ producer even though rabbitMQ consumers consume concurrent 5 requests at a time but Camunda isn't able to fetch all those variables as per concurrent requests. 2. 任务 1:当我们向 rabbitMQ 生产者发出多个请求时,该服务任务不会获取所有变量,尽管 rabbitMQ 消费者一次同时消耗 5 个并发请求,但 Camunda 无法根据并发请求获取所有这些变量。

Note : One request at a time is fetching all data from Camunda variables.注意:一次一个请求是从 Camunda 变量中获取所有数据。

3. Task 3: The Same issue happing in Task 2 as well. 3. 任务 3:同样的问题也出现在任务 2 中。

This behavior is random, sometimes in task 1 or task 2 or sometimes works fine.这种行为是随机的,有时在任务 1 或任务 2 中或有时工作正常。

在此处输入图片说明

If I understand correctly, some event is creating queued items from rabbitMQ and this one in turn starts processes in Camunda.如果我理解正确的话,某个事件正在从 rabbitMQ 创建排队项目,而这个事件又会在 Camunda 中启动进程。 If this is the case, consider using the event that creates item in the rabbitMQ queue to create the direct process in Camunda via RestAPI.如果是这种情况,可以考虑使用在rabbitMQ队列中创建item的事件通过RestAPI在Camunda中创建直接进程。 Consider using External Task on task 1 of your process, so Camunda would do the orchestration and queue function at the same time, eliminating the need to use rabbitMQ.考虑在流程的任务 1 上使用 External Task,这样 Camunda 会同时完成编排和队列功能,无需使用 rabbitMQ。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM