Skip to main content

Configuration

Configuration properties and defaults of the Error Handling Service (EHS), grouped by topic. Runtime behavior is documented in Message Flows, operational procedures in Operations. Baseline defaults are defined in errorhandlerDefaultProperties.properties of the service library. A complete example configuration can be found in the jme-messaging-error-scs module of the jme-messaging-example project.

Kafka​

The EHS consumes MessageProcessingFailedEvents from the error topic of the system. When Modulith error handling is enabled, it consumes ModulithPublicationProcessingFailedEvents from a separate topic. The general Kafka and schema registry access is configured through the standard jEAP messaging properties (jeap.messaging.kafka.*). The essential EHS-specific settings are:

jeap:
errorhandling:
# The topic the EHS consumes MessageProcessingFailedEvents from. All Kafka message
# consumers of the system publish their failures here (jeap.messaging.kafka.errorTopicName).
topic: "yoursystem-messageprocessing-failed"
# Optional: the dedicated topic the EHS consumes Modulith publication failures from.
modulithPublicationProcessingFailedTopic: "yoursystem-modulith-publication-processing-failed"
# The dead letter topic for failures of the EHS itself, see Operations.
deadLetterTopicName: "yoursystem-messageprocessing-deadletter"
messaging:
kafka:
systemName: YOURSYSTEMNAME
serviceName: ${spring.application.name}

Note that for the EHS itself, jeap.messaging.kafka.errorTopicName always equals the dead letter topic — the EHS must not publish its own failures to the topic it consumes from.

To also handle Modulith failures, set jeap.errorhandling.modulithPublicationProcessingFailedTopic. When it is unset, EHS does not create a Modulith failure consumer. Retry and discard destinations come from the failure event, so no command-topic properties are required in EHS. See Multi-cluster support for the cluster configuration lifecycle.

The EHS keeps its deliberately no-op ErrorServiceContractValidator; the failure event and retry/discard commands require no message contracts in the EHS instance. This does not exempt the source microservice's command consumers: an application using the Modulith error handling starter must declare both retry and discard consumer contracts for its configured topics. The enabled starter checks these at startup using the application's existing validator. The source microservice needs no producer contract for the failure event because jEAP Messaging exempts that framework-owned event.

The topic configuration is validated at startup, the EHS refuses to start if:

  • jeap.errorhandling.topic or jeap.errorhandling.deadLetterTopicName is missing,
  • jeap.errorhandling.topic and jeap.errorhandling.deadLetterTopicName name the same topic — the EHS would consume its own failures again and the dead letter reactivation would republish messages into the topic it just read from,
  • jeap.errorhandling.modulithPublicationProcessingFailedTopic, when configured, names either the regular error topic or the dead letter topic,
  • jeap.messaging.kafka.errorTopicName is configured to something other than the dead letter topic, for the default cluster or for any cluster in jeap.messaging.kafka.cluster.*.

Target-service headers for Modulith commands​

EHS enables durable outbox headers by default, so retry and discard commands carry jeap_eh_target_service (the failure event's publishing service) and jeap_eh_error_handling_service (this EHS's service name). No instance configuration is required. The headers are stored atomically with the command and survive delayed outbox relay and resend. The existing jEAP target filter discards commands addressed to a different service before invoking its listener; UUID and failure-generation validation remain unchanged. This does not change command topics, Kafka ACLs, signing, or contracts.

Header storage can be disabled explicitly if an instance must temporarily retain legacy command delivery:

jeap:
messaging:
transactional-outbox:
headers-enabled: false

Flyway is enabled by default for EHS and migration V15_0_0 automatically creates the additive deferred_message_header table before header storage is used. No existing column changes. During a rolling upgrade, run the migration before an upgraded instance starts sending header-bearing commands and do not run old relay code while such commands remain eligible for delivery or resend. Existing headerless commands remain readable and retain their previous behavior; the migration does not retrofit target headers onto them.

Retry of temporary EHS failures​

If the EHS hits a transient problem while consuming (e.g. the database is briefly unavailable), it retries the consumption instead of routing the event to the dead letter topic:

PropertyDescriptionDefault
jeap.errorhandling.kafka.errorhandling.retry-intervalInterval between consumption attempts after a transient processing failure (any Spring Duration format).30s

A custom Spring Kafka BackOff bean named KafkaErrorHandlingConfiguration.BACKOFF_BEAN_NAME can be provided for more detailed control, see Customization.

Dead letter reactivation​

Tuning of the dead letter reactivation:

PropertyDescriptionDefault
jeap.errorhandling.dead-letter-reactivation.max-poll-recordsMaximum number of dead letter messages forwarded and committed as one batch.500
jeap.errorhandling.dead-letter-reactivation.idle-timeoutA reactivation run ends if it could not make any progress for this duration (any Spring Duration format).60s

The number of messages pending on the dead letter topic, shown on every page of the UI and published as the eh_deadletter_pending_messages gauge (see Operations), is re-determined periodically and immediately after a reactivation run. Each refresh reads topic and consumer group offset metadata only (no messages are fetched), so a shorter interval than the database-backed metrics is fine:

PropertyDescriptionDefault
jeap.errorhandling.dead-letter-count.updateFrequencyMillisInterval at which the pending message count is re-determined, in milliseconds.30000

The broker expires the committed progress of a reactivation after offsets.retention.minutes if the consumer group does not commit. A scheduled job therefore commits the existing offsets again, see Operations:

PropertyDescriptionDefault
jeap.errorhandling.dead-letter-offset-keep-alive.enabledEnables the job.true
jeap.errorhandling.dead-letter-offset-keep-alive.intervalMinimum time between two renewals (ISO-8601 duration), enforced across all instances by a database lock. Must be clearly shorter than the broker's offsets.retention.minutes (7 days by default).PT24H
jeap.errorhandling.dead-letter-offset-keep-alive.check-intervalHow often each instance checks whether a renewal is due. The actual period between renewals is interval plus up to check-interval.PT3H
jeap.errorhandling.dead-letter-offset-keep-alive.initial-delayDelay after startup before the first check. Short, so that instances restarting more often than interval still renew.PT10M

Every renewal and every skipped or failed round is logged (info and warn). A round that fails or is skipped because a reactivation is active is retried only after interval, as the database lock is held either way.

The job needs the same Kafka permissions as the reactivation consumer (read access to the dead letter topic and the consumer group).

Each refresh opens a short-lived Kafka consumer, which is closed again right after reading the offsets, on every instance. There is deliberately no long-lived client: it would keep its connections to the brokers open permanently, which counts against the brokers' connection limits, whereas the short-lived consumer holds connections only for the duration of the refresh. The price is a new connection and login per refresh and instance. If the connection rate matters on a cluster, increase updateFrequencyMillis (the UI follows automatically); the count then lags behind by up to that interval, except after a reactivation run, which triggers an immediate refresh.

The UI polls the count at the same interval: it reads the configured value from GET /api/configuration/dead-letter-count-update-frequency once on load, so the two stay in sync without separate frontend configuration.

Frontend and OAuth​

The EHS UI is secured with OAuth2/OIDC; the backend is a jEAP OAuth2 resource server (jeap.security.oauth2.resourceserver.*, see the jEAP security documentation).

jeap:
errorhandling:
frontend:
client-id: "error-handling-ui" # OAuth client configured in the identity provider
system-name: "jme" # system name used in the role names
auto-login: true
silent-renew: true
renew-user-info-after-token-renew: true
application-url: http://localhost:8072/error-handling/
redirect-url: http://localhost:8072/error-handling/redirect
logout-redirect-uri: http://localhost:4199/
mock-pams: true
pams-environment: REF
security:
oauth2:
resourceserver:
system-name: "jme"

The required user roles are described in User Interface.

PAMS / ePortal​

The UI uses Oblique's ePortal service navigation. See the shared PAMS and ePortal guide for integration responsibilities and environment alignment.

Configure this service under jeap.errorhandling.frontend:

Property suffixMeaningDefault
pams-enabledEnable PAMS/ePortal integration.true
pams-environmentService-navigation environment: DEV, TEST, REF, ABN or PROD. Required unless PAMS is disabled.None
mock-pamsTreat the PAMS session as active instead of reading its state from the service navigation. Also implied by pams-enabled: false.false

The selected environment determines the portal endpoint used by the service navigation. Select the environment matching the UI's identity provider; do not construct endpoint names from the enum values.

For a deployment without PAMS:

jeap:
errorhandling:
frontend:
pams-enabled: false

This disables ePortal requests and PAMS session-timeout handling. Authentication uses OAuth2/OIDC; PAMS header controls (login/logout, profile and messages) are hidden, while language selection remains available. mock-pams only mocks session state; use pams-enabled to disable portal integration.

Error list view defaults​

The default filter settings of the error list view are configurable. A user's locally persisted view settings (browser local storage) take precedence over these defaults.

PropertyDescriptionDefault
jeap.errorhandling.error-list.default-no-ticket-filterDefault value of the "no Jira ticket" filter of the error list view.false
jeap.errorhandling.error-list.default-state-filterDefault error state filter of the error list view (PERMANENT, TEMPORARY, RETRIED or DELETED).PERMANENT

The UI opens the log system from the failed processing on the error details page.

PropertyMeaning
log.deep-link.base-urlLog query URL template containing the literal {traceId} token, replaced by the UI.

Set the URL for the deployment's logging environment. The shared Log deep links guide explains the approach and provides Splunk and CloudWatch query examples.

Resending​

Temporary errors are retried by the DefaultResendingStrategy:

PropertyDescriptionDefault
jeap.errorhandling.resend.default-resend-strategy.delay(Minimal) delay between receiving a failed message and resending it.30s
jeap.errorhandling.resend.default-resend-strategy.max-retriesMaximum number of resends per failed message; afterwards the error becomes permanent.15
jeap.errorhandling.resend.default-resend-strategy.exponential-backoff-enabledWhether the delay grows exponentially with each retry.true
jeap.errorhandling.resend.default-resend-strategy.exponential-backoff-factorMultiplier applied to the previous delay for the next resend.2
jeap.errorhandling.resend.default-resend-strategy.exponential-backoff-max-delayUpper bound of the delay when exponential back-off is enabled.1d

A custom ResendingStrategy bean can replace the default, see Customization.

Resend headers​

The following Kafka headers are set on resent messages:

HeaderValuePurpose
jeap_eh_target_serviceName of the service whose processing failedUsed by jEAP messaging to filter out messages resent for other services
jeap_eh_error_handling_serviceName of the resending EHS instanceDebugging

Agir task management​

Permanent errors create a manual task in the Agir task management service (task type errorhandling). For local setups and tests the integration can be disabled — calls to Agir are then only logged.

PropertyDescriptionDefault
jeap.errorhandling.task-management.service.enabledWhether the Agir task management service is integrated.true
jeap.errorhandling.task-management.service.urlURL of the Agir task management service.-
jeap.errorhandling.task-management.service.client-idClient id of the Spring Security OAuth2 client registration used to authenticate against Agir.-

The EHS authenticates against Agir with a standard Spring Security OAuth2 client registration (spring.security.oauth2.client.*); the issuer must be the Agir realm.

Task creation is handled by the DefaultTaskFactory:

PropertyDescriptionDefault
jeap.errorhandling.task-management.default-factory.errorServiceBaseUrlBase URL of the EHS, used for links from the task back into the EHS.-
jeap.errorhandling.task-management.default-factory.priorityPriority of the created tasks.HIGH
jeap.errorhandling.task-management.default-factory.systemSystem the tasks are assigned to.-
jeap.errorhandling.task-management.default-factory.timeToHandleTime a user has to handle the task.1d
jeap.errorhandling.task-management.default-factory.domainAgir domain the task is filed under.error-handling
jeap.errorhandling.task-management.default-factory.taskReferenceNameTitle of the link back to the EHS.Error Service

The task type display in Agir is configurable per language:

jeap.errorhandling.task-management.default-factory:
display:
DE:
title: "Fehlgeschlagene Nachrichten-Verarbeitung"
description: "Ein technischer Fehler ist aufgrund einer unverarbeitbaren Nachricht aufgetreten."
displayName: "Nachrichten-Verarbeitungsfehler"
displayDomain: "Error Handling"
# FR / IT / EN analogous

A custom TaskFactory bean can replace the default, see Customization.

OAuth client registration for Agir​

The task-management client-id property selects the Spring registration name, for example agir-client. It is distinct from the OAuth client ID supplied by the identity provider:

jeap:
errorhandling:
task-management:
service:
client-id: agir-client
spring:
security:
oauth2:
client:
registration:
agir-client:
client-id: ${AGIR_CLIENT_ID}
client-secret: ${AGIR_CLIENT_SECRET}
authorization-grant-type: client_credentials
provider: agir-provider
provider:
agir-provider:
issuer-uri: ${AGIR_ISSUER_URI}

Jira issue tracking​

The Jira integration for error groups is optional — simply omit the issue tracking and Jira properties to disable it.

PropertyDescriptionDefault
jeap.errorhandling.error-groups.issue-tracking.projectThe Jira project in which tickets are created.-
jeap.errorhandling.error-groups.issue-tracking.issue-typeThe type of the created tickets.Bug
jeap.errorhandling.error-groups.issue-tracking.issue-summary-templateTemplate for the ticket summary. Supported parameters: group-id, group-created-datetime, message-type, source, error-code, error-count.Processing of '{message-type}' from '{source}' fails with '{error-code}'
jeap.errorhandling.error-groups.issue-tracking.error-handling-service-group-url-templateURL template linking back to an error group in the EHS, with the {groupId} placeholder. Used in the ticket description.-
jeap.errorhandling.jira.base-urlURL of the Jira instance.-
jeap.errorhandling.jira.usernameUser name for the Jira access and/or reporter of the ticket.-
jeap.errorhandling.jira.passwordPassword for basic authentication. May be empty when token is set.-
jeap.errorhandling.jira.tokenToken for bearer authentication. Takes precedence over password.-

Example:

jeap:
errorhandling:
error-groups:
issue-tracking:
project: "JME"
error-handling-service-group-url-template: "${jeap.errorhandling.frontend.application-url}/error-group-details/{groupId}"
jira:
base-url: "https://jira.example.com"
username: "${username.secret.from.secrets.manager}"
token: "${token.secret.from.secrets.manager}"

Technical user for the Jira integration​

Recommended setup for the Jira access:

  1. Create a dedicated technical user (S-user) for automated ticket creation.
  2. Grant it minimal permissions: create issues only (no read/edit), only on the Jira projects used by the EHS instances, plus UI login to create a token.
  3. Log in to the Jira UI with the technical user and create a Personal Access Token (with automatic expiry) under Profile → Personal Access Tokens.
  4. Store the user name and token in the secret store of the platform (Vault or AWS Secrets Manager) and reference them in the jeap.errorhandling.jira.username / token properties.

Error groups​

PropertyDescriptionDefault
jeap.errorhandling.error-groups.errorGroupingEnabledEnable or disable the creation of error groups.true
jeap.errorhandling.frontend.ticketingSystemUrlURL of a ticket in the ticketing system with a {ticketNumber} placeholder.None — required; for example https://jira.example.com/browse/{ticketNumber}

The default sorting of the error group view is configurable; a user's locally persisted sorting takes precedence over the configured default:

PropertyDescriptionDefault
jeap.errorhandling.error-groups.default-sort-fieldDefault sort column of the group view.latestErrorAt
jeap.errorhandling.error-groups.default-sort-orderDefault sort direction (ASC / DESC).DESC

Housekeeping and metrics​

Housekeeping retention and scheduling properties:

PropertyDescriptionType / FormatDefault
jeap.errorhandling.housekeeping.scheduler.cronExpressionWhen the housekeeping scheduler runs.Cron0 40 00 * * * (daily at 00:40)
jeap.errorhandling.housekeeping.scheduler.lockAtLeastMinimum duration the ShedLock lock is held.Duration5S
jeap.errorhandling.housekeeping.scheduler.lockAtMostMaximum duration the ShedLock lock is held.Duration30M
jeap.errorhandling.housekeeping.errorMaxAgeAge after which errors are deleted.Duration180D
jeap.errorhandling.housekeeping.pageSizeEntries deleted per page; each page is deleted in its own transaction.int100
jeap.errorhandling.housekeeping.maxPagesMaximum number of pages cleaned per run.int100000

See Operations for the deletion criteria.

The metric gauges are sampled every 60 seconds by default. Configure the interval with jeap.errorhandling.metrics.updateFrequencyMillis. Each sampling executes database counts, so a higher sampling frequency is not recommended. See Operations for the metrics.

  • Getting Started — setting up an EHS instance
  • Operations — dead letter topic, housekeeping, metrics, multi-cluster
  • Customization — custom resending strategy, task factory and back-off