Skip to main content

Getting Started

This repository is published as a library: every business system runs its own instance of the Error Handling Service (EHS). This page describes how to set up such an instance. Every jEAP application that consumes messages must have an EHS — a message must never be lost, even when its consumer cannot process it.

1. Create the instance repository​

Create a source code repository for your EHS instance containing:

  • a POM with the parent jeap-error-handling-service-instance:

    <parent>
    <groupId>ch.admin.bit.jeap</groupId>
    <artifactId>jeap-error-handling-service-instance</artifactId>
    <version><!-- use the latest version --></version>
    <relativePath/>
    </parent>
  • configuration files (application-<env>.yml), see Configuration.

An instance can initially be created after the template of the jme-messaging-error-scs module in the jme-messaging-example project. Note that this template shows the instantiation inside a multi-module project: it does not use jeap-error-handling-service-instance as parent and therefore adds the jeap-error-handling-service dependency explicitly. In multi-module setups, make sure the jeap-spring-boot-parent version of the project parent matches the one used by the EHS dependency.

2. Order the Kafka topics​

Two topics are required per system. Modulith error handling adds one shared failure topic and retry and discard command topics for each source service (see the platform documentation on creating Kafka topics):

TopicNaming conventionPurpose
Message processing failure topic<system>-messageprocessing-failedKafka message consumers publish MessageProcessingFailedEvents here (jeap.messaging.kafka.errorTopicName); the EHS consumes it (jeap.errorhandling.topic).
Modulith publication failure topic<system>-modulith-publication-processing-failedServices using the Modulith starter publish ModulithPublicationProcessingFailedEvents here; configure jeap.errorhandling.modulithPublicationProcessingFailedTopic.
Modulith retry command topic<system>-<service>-retry-modulith-publicationThe EHS publishes retry commands here; configure jeap.modulith.error-handling.retry-command-topic in the source service.
Modulith discard command topic<system>-<service>-discard-modulith-publicationThe EHS publishes discard commands here; configure jeap.modulith.error-handling.discard-command-topic in the source service.
Dead letter topic<system>-messageprocessing-deadletterFailures of the EHS itself (jeap.errorhandling.deadLetterTopicName), see Operations.

The configured topics must be distinct; see Kafka configuration for startup validation rules. Retry and discard topics must likewise not overlap topics carrying another message type.

The Kafka user of the EHS needs read access to both configured failure topics, write access to the dead letter and Modulith command topics, and write access to every topic the EHS must be able to resend messages to.

For Modulith onboarding, reuse the system's existing EHS with Modulith support. The application publishes failure events; the EHS consumes them and publishes retry/discard commands back to that application. Permissions must be granted separately to the application and EHS Kafka identities. No additional command-topic properties are needed in EHS: the failure event supplies the reply destinations. Roll out the configuration and restart EHS to activate the failure listener before testing.

The starter's Kafka topics and service responsibilities guide lists the producers, consumers, topic properties, contracts and permissions on each side, together with signing requirements and a first end-to-end check. Internal Modulith events do not themselves require Kafka topics.

3. Configure the consumers of your system​

Enable the jEAP messaging error handling in every service that consumes messages: configure jeap.messaging.kafka.errorTopicName to the error topic. The jEAP messaging error handler then wraps processing failures into MessageProcessingFailedEvents automatically. Classify failures that are worth retrying as temporary by throwing exceptions that implement MessageHandlerExceptionInformation.

4. Configure the EHS instance​

The following excerpt shows the main service-specific settings. It is not a complete runnable configuration. Supply the deployment's datasource connection and credentials, Kafka/schema-registry connection and authentication, and OAuth issuer. Complete the frontend settings, including the required ticket URL and either the PAMS environment or pams-enabled=false, and configure the log link. Configure Agir or explicitly disable it as described below. The complete integration examples show how these settings fit together.

jeap:
errorhandling:
topic: "yoursystem-messageprocessing-failed"
# Required only when this EHS handles failed Modulith publications
modulithPublicationProcessingFailedTopic: "yoursystem-modulith-publication-processing-failed"
deadLetterTopicName: "yoursystem-messageprocessing-deadletter"
frontend:
client-id: "error-handling-ui"
system-name: "yoursystem"
application-url: https://yoursystem.example.com/error-handling/
messaging:
kafka:
systemName: YOURSYSTEM
serviceName: ${spring.application.name}

For Modulith message-contract requirements on the EHS and source-service sides, see Kafka configuration.

5. Set up authorization​

Create the OAuth client for the UI in the identity provider and assign the user roles described in User Interface (<systemname>_@error_#view / #retry / #delete and the errorgroup roles).

Order access to Agir, create a client in the Agir realm and configure the task management integration so that permanent errors create manual tasks. For local development the integration can be disabled (jeap.errorhandling.task-management.service.enabled=false).

7. Connect Jira (optional)​

Configure the Jira issue tracking integration to create and link tickets on error groups.

Next steps​

Complete integration examples​

The following source examples include the complete build, configuration and plugin implementations. Use them with the version of the service you integrate; the examples evolve with their repositories.

Frontend dependency compatibility​

The UI uses Angular 21, Oblique 15 and Quadrel Auth 21. Quadrel Auth currently requires Angular 21; upgrading to Oblique 16 / Angular 22 also requires a compatible Quadrel release. Install dependencies with npm ci without --legacy-peer-deps.