簡體   English   中英

從異步郵件任務向Activiti 5.21遷移到6.0.0的問題

[英]Activiti 5.21 to 6.0.0 migration issue on Async mail task

我正在從Activiti版本5.21遷移到6.0.0的過程中。 除了預期的更改(有些意外)之外,在執行異步郵件任務時,我還遇到了一個有趣的問題。 Mail任務將按預期方式發送消息,並且不會引發任何錯誤,但是,盡管操作成功,但仍遵循對失敗流程的重試。 嘗試3次(發送3封電子郵件)后,作業將移至死信表,就好像發生了錯誤一樣。 表中的錯誤消息是

“ JobEntity [id = SOME ID]已由另一個事務同時更新”

奇怪的是,Activiti沒有拋出任何錯誤。 我將日志級別設置為可跟蹤,似乎沒有異常。

根據用戶指南( https://www.activiti.org/userguide/#failRetry ),如果發生某些故障,我希望嘗試重試該操作,但是在這種情況下,沒有任何故障,並且郵件已正確發送。

如果將Process config AsyncExecutorNumberOfRetries屬性設置為零(configurationImpl.setAsyncExecutorNumberOfRetries(0);),則可以避免此錯誤,但這似乎不是我應該做的事情。

ProcessEngineConfigurationImpl中asyncExecutorNumberOfRetries屬性的默認值為3,因此可以解釋這3次嘗試,但是我想知道為什么引擎沒有捕獲成功的郵件事件並將其視為失敗。

這是我的bpmn模型代碼:這只是帶有電子郵件和臨時任務的簡單開始/結束事件。

    <?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:activity="http://activiti.org/bpmn" xmlns:klover="http://klover.io/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="MigrationTest3" name="Migration Test 3" isExecutable="true" klover:category="tenant1|Incident:TaskCategoryType">
<bpmn:documentation>test 3</bpmn:documentation>
<bpmn:startEvent id="StartEvent_1" name="Start Event" activity:initiator="initiator">
  <bpmn:documentation>This element denotes the start of the process instance</bpmn:documentation>
  <bpmn:outgoing>SequenceFlow_0xdrrlx</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="ServiceTask_0p317lq" name="MIgration Test 3" activity:async="true" activity:type="mail">
  <bpmn:documentation>This element denotes the service to send email</bpmn:documentation>
  <bpmn:extensionElements>
    <activity:field name="from">
      <activity:expression></activity:expression>
    </activity:field>
    <activity:field name="to">
      <activity:expression>me@test.org</activity:expression>
    </activity:field>
    <activity:field name="subject">
      <activity:expression>Test Migration 3</activity:expression>
    </activity:field>
    <activity:field name="text">
      <activity:expression>testing re-enabling async mail task - did this   send 3 times?</activity:expression>
    </activity:field>
  </bpmn:extensionElements>
  <bpmn:incoming>SequenceFlow_0xdrrlx</bpmn:incoming>
  <bpmn:outgoing>SequenceFlow_0wboybt</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:endEvent id="EndEvent_11vu7d5" name="Undefined End Event">
<bpmn:documentation>This element denotes the end of the process instance</bpmn:documentation>

<bpmn:incoming>SequenceFlow_17ff3nr</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_0xdrrlx" sourceRef="StartEvent_1" targetRef="ServiceTask_0p317lq" />
<bpmn:sequenceFlow id="SequenceFlow_0wboybt" sourceRef="ServiceTask_0p317lq" targetRef="UserTask_1sghk67" />
<bpmn:userTask id="UserTask_1sghk67" name="Testing Adhoc task after email" activity:assignee="tenant1|718abdcf-e192-11e5-b7f0-9f235e785c94" activity:priority="0" klover:formType="Adhoc">
<bpmn:documentation>Testing the new execution id change</bpmn:documentation>
<bpmn:incoming>SequenceFlow_0wboybt</bpmn:incoming>
  <bpmn:outgoing>SequenceFlow_17ff3nr</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="SequenceFlow_17ff3nr" sourceRef="UserTask_1sghk67" targetRef="EndEvent_11vu7d5" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MigrationTest3">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="44" y="84" width="36" height="36" />
<bpmndi:BPMNLabel>
      <dc:Bounds x="34" y="120" width="55" height="12" />
    </bpmndi:BPMNLabel>
  </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0p317lq_di" bpmnElement="ServiceTask_0p317lq">
    <dc:Bounds x="285" y="128" width="100" height="80" />
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape id="EndEvent_11vu7d5_di" bpmnElement="EndEvent_11vu7d5">
    <dc:Bounds x="663" y="281" width="36" height="36" />
    <bpmndi:BPMNLabel>
      <dc:Bounds x="644" y="317" width="74" height="24" />
    </bpmndi:BPMNLabel>
  </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0xdrrlx_di" bpmnElement="SequenceFlow_0xdrrlx">
    <di:waypoint xsi:type="dc:Point" x="80" y="102" />
    <di:waypoint xsi:type="dc:Point" x="183" y="102" />
    <di:waypoint xsi:type="dc:Point" x="183" y="168" />
    <di:waypoint xsi:type="dc:Point" x="285" y="168" />
    <bpmndi:BPMNLabel>
      <dc:Bounds x="198" y="125" width="0" height="0" />
    </bpmndi:BPMNLabel>
  </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0wboybt_di" bpmnElement="SequenceFlow_0wboybt">
    <di:waypoint xsi:type="dc:Point" x="385" y="168" />
    <di:waypoint xsi:type="dc:Point" x="452" y="168" />
    <di:waypoint xsi:type="dc:Point" x="452" y="207" />
    <di:waypoint xsi:type="dc:Point" x="453" y="259" />
    <bpmndi:BPMNLabel>
      <dc:Bounds x="467" y="187.5" width="0" height="0" />
    </bpmndi:BPMNLabel>
  </bpmndi:BPMNEdge>
  <bpmndi:BPMNShape id="UserTask_1sghk67_di" bpmnElement="UserTask_1sghk67">
    <dc:Bounds x="403" y="259" width="100" height="80" />
  </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_17ff3nr_di" bpmnElement="SequenceFlow_17ff3nr">
    <di:waypoint xsi:type="dc:Point" x="503" y="299" />
    <di:waypoint xsi:type="dc:Point" x="581" y="299" />
    <di:waypoint xsi:type="dc:Point" x="581" y="299" />
    <di:waypoint xsi:type="dc:Point" x="663" y="299" />
    <bpmndi:BPMNLabel>
      <dc:Bounds x="596" y="299" width="0" height="0" />
    </bpmndi:BPMNLabel>
  </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

任何建議將不勝感激!

事實證明,這里的問題是在我們的DEV環境中,當每個開發人員都在處理應用程序時,我們啟動了流程引擎的多個實例。 因為當時我是唯一的工作人員,所以最初我並不認為這是問題所在。 原來我們有一個運行引擎的舊應用服務器。 隨后,它在與我的本地實例不同的AWS時區上運行。 這是導致感知到的故障的原因,因為此AWS實例的鎖定時間在UTC上,而我在本地MST上運行。

設置了包含的本地環境后,我的異步郵件任務按預期方式執行... 1次

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM