We have implemented custom HistoryEventHandler to catch the history events generated by process engine, wrap the events with meta info and publish the messages to a Kafka topic for other microservices to consume. During testing we have identified duplicate history events are generated for the same type of event -
Ex: Below event is generated multiple times with exact same field values
{
“id”: “usertask__5_2:8216d8c9-1ade-11ec-9406-7ac2424d5a1b”,
“rootProcessInstanceId”: “8213a55c-1ade-11ec-9406-7ac2424d5a1b”,
“processInstanceId”: “8213a55c-1ade-11ec-9406-7ac2424d5a1b”,
“executionId”: “8216b1b6-1ade-11ec-9406-7ac2424d5a1b”,
“processDefinitionId”: “alx-p15:4:81abe2db-1ade-11ec-9406-7ac2424d5a1b”,
“processDefinitionKey”: “alx-p15”,
“processDefinitionName”: null,
“processDefinitionVersion”: null,
“caseInstanceId”: null,
“caseExecutionId”: null,
“caseDefinitionId”: null,
“caseDefinitionKey”: null,
“caseDefinitionName”: null,
“eventType”: “start”,
“sequenceCounter”: 9,
“removalTime”: null,
“durationInMillis”: null,
“startTime”: “2021-09-21T13:19:10.924+00:00”,
“endTime”: null,
“activityId”: “usertask__5_2”,
“activityName”: “alx-t1-15”,
“activityType”: “userTask”,
“activityInstanceId”: “usertask__5_2:8216d8c9-1ade-11ec-9406-7ac2424d5a1b”,
“activityInstanceState”: 0,
“parentActivityInstanceId”: “subprocess__3_2:8216b1b7-1ade-11ec-9406-7ac2424d5a1b”,
“calledProcessInstanceId”: null,
“calledCaseInstanceId”: null,
“taskId”: null,
“taskAssignee”: null,
“tenantId”: null,
“canceled”: false,
“assignee”: null,
“completeScope”: false,
“durationRaw”: null,
“persistentState”: “org.camunda.bpm.engine.impl.history.event.HistoryEvent”
}
Is it a bug in Camunda (may be all the fields updated in DB are not present in the event message) or configuration issue?