Skip to content

Commit

Permalink
bugfix(#1253): configure dlq to raise incidents and fix IncidentAdapt…
Browse files Browse the repository at this point in the history
…er in connector
  • Loading branch information
lmoesle committed Feb 1, 2024
1 parent 6179a4a commit 541ab0b
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import de.muenchen.oss.digiwf.email.integration.infrastructure.MonitoringService;
import de.muenchen.oss.digiwf.email.integration.model.Mail;
import de.muenchen.oss.digiwf.message.process.api.ErrorApi;
import de.muenchen.oss.digiwf.message.process.api.error.BpmnError;
import de.muenchen.oss.digiwf.message.process.api.error.IncidentError;
import jakarta.validation.ValidationException;
import lombok.RequiredArgsConstructor;
import org.springframework.messaging.Message;

Expand All @@ -20,23 +23,23 @@ public class MessageProcessor {

public Consumer<Message<Mail>> emailIntegration() {
return message -> {
// try {
try {
this.mailUseCase.sendMail(
message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID, String.class),
message.getHeaders().get(TYPE, String.class),
message.getHeaders().get(DIGIWF_INTEGRATION_NAME, String.class),
message.getPayload());
this.monitoringService.sendMailSucceeded();
// } catch (final BpmnError bpmnError) {
// this.monitoringService.sendMailFailed();
// this.errorApi.handleBpmnError(message.getHeaders(), bpmnError);
// } catch (final ValidationException validationException) {
// this.monitoringService.sendMailFailed();
// this.errorApi.handleBpmnError(message.getHeaders(), new BpmnError("VALIDATION_ERROR", validationException.getMessage()));
// } catch (final IncidentError incidentError) {
// this.monitoringService.sendMailFailed();
// this.errorApi.handleIncident(message.getHeaders(), incidentError);
// }
} catch (final BpmnError bpmnError) {
this.monitoringService.sendMailFailed();
this.errorApi.handleBpmnError(message.getHeaders(), bpmnError);
} catch (final ValidationException validationException) {
this.monitoringService.sendMailFailed();
this.errorApi.handleBpmnError(message.getHeaders(), new BpmnError("VALIDATION_ERROR", validationException.getMessage()));
} catch (final IncidentError incidentError) {
this.monitoringService.sendMailFailed();
this.errorApi.handleIncident(message.getHeaders(), incidentError);
}
};
}

Expand Down

0 comments on commit 541ab0b

Please sign in to comment.