Interface ErrorRegistry

All Superinterfaces:
AutoCloseable, ErrorRegistryView, Service, StaticService

public interface ErrorRegistry extends ErrorRegistryView, StaticService
A registry which captures exceptions that occurred during message routing and stores them in memory.

This is an opt-in feature that must be enabled. When enabled, the registry captures error snapshots (exception type, message, stack trace) without retaining references to the original exchange or exception objects.

The registry has a configurable maximum capacity and time-to-live to prevent unbounded memory growth and stale data.

The registry itself implements ErrorRegistryView for global scope, and scoped views for individual routes can be obtained via forRoute(String).

See Also:
  • Method Details

    • forRoute

      ErrorRegistryView forRoute(String routeId)
      Gets a view scoped to a specific route.

      The returned view is a lightweight filter over the same underlying data.

      Parameters:
      routeId - the route id
      Returns:
      a view containing only errors from the given route
    • isEnabled

      boolean isEnabled()
      Whether the error registry is enabled
    • setEnabled

      void setEnabled(boolean enabled)
      Sets whether the error registry is enabled.

      This is by default disabled.

    • getMaximumEntries

      int getMaximumEntries()
      The maximum number of error entries to keep in the registry
    • setMaximumEntries

      void setMaximumEntries(int maximumEntries)
      Sets the maximum number of error entries to keep. When the limit is exceeded, the oldest entries are evicted.

      The default value is 100.

    • getTimeToLive

      Duration getTimeToLive()
      The time-to-live for error entries
    • setTimeToLive

      void setTimeToLive(Duration timeToLive)
      Sets the time-to-live for error entries. Entries older than this duration are evicted.

      The default value is 1 hour.

    • isStackTraceEnabled

      boolean isStackTraceEnabled()
      Whether stack trace capture is enabled
    • setStackTraceEnabled

      void setStackTraceEnabled(boolean stackTraceEnabled)
      Sets whether to capture stack traces. This is enabled by default.