it-at-m / digiwf-project

Project repo for the DigiWF project automation platform.
MIT License
10 stars 1 forks source link

Generic error handling #107

Closed lmoesle closed 2 years ago

lmoesle commented 2 years ago

As a integration service developer I want to be able to send technical and business errors to the engine. As a process modeler I want to react on error in the model.

Description

The digiwf engine communicates with integration artifacts via asynchronous events sent through Kafka. If an error appears during event processing in the integration artifact, an error event is sent to a configured dead letter queue (dlq). At the moment the errors in the dlq topic are not handled. This behaviour is not ideal, as errors are not detected. To improve the error handling of async events we should listen to error events sent to the dlq and handle them properly in digiWF engine.

Estimation: 20 Days

Details

Digiwf-integration-errors topics

Request a digiwf-integration-errors topic that can be used as a dlq for integration artefacts. Authorize kafka users for the topic

DTO for creating incidents

For creating incidents it is necessary to know in which context the incident should be created. The Incident should be created on the receive task / message event in the bpmn process. to be more precise, in the corresponding job of the message. To query for the message we need the same parameters as we need for correlating. For the first version we can restrict it to:

spring cloud stream Incident handler

Create a handler for the header type createIncident The should query for the corresponding exectuion with this.runtimeService.createEventSubscriptionQuery() and use this.runtimeService.createIncident() for creating an incident.

DTO for creating bpmn error

For creating incidents we it is necessary to know in which context the bpmn error should be created.

spring cloud stream bpmn error handler

Create a handler for the header type createBpmnError Check alternatives for correlating messages Correlate the message with the parameters that determine that it is a bpmn error

enable bpmn errors by input variable

Only throw bpmn errors if the variable app_bpmn_erorrs_enabled is activated (true)

create example process

Create an example process for incidents and bpmn errors

extend spring cloud stream utils

Extend the spring cloud stream utils for throwing bpmn errors and creating incidents

dominikhorn93 commented 2 years ago

image.png

dominikhorn93 commented 2 years ago

image.png

dominikhorn93 commented 2 years ago

Idea:

lmoesle commented 2 years ago

Foto 07.07.22, 13 44 39.jpg

Dicussion with @dominikhorn93 : For testing purposes we should create an example-integration service. This example-integration service is useful for this feature to send bpmnError and incident events to the corresponding kafka topics.

dominikhorn93 commented 2 years ago

@lmoesle I have added 3 slides in that presentation (Connector section) One is about the package structure, another about a sample mail use case and the last one about the local setup https://docs.google.com/presentation/d/1ReihB4kIMPViTVJgL91b2mfxGhZccRWbTKBjdQNF1sM/edit

I will merge the current state of DigiWF-core into dev. Is nothing for production usage and of course still in beta. But you have to create new branches next week.