Package org.apache.camel.spi
Interface ErrorRegistry
- All Superinterfaces:
AutoCloseable,ErrorRegistryView,Service,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 Summary
Modifier and TypeMethodDescriptionGets a view scoped to a specific route.intThe maximum number of error entries to keep in the registryThe time-to-live for error entriesbooleanWhether the error registry is enabledbooleanWhether stack trace capture is enabledvoidsetEnabled(boolean enabled) Sets whether the error registry is enabled.voidsetMaximumEntries(int maximumEntries) Sets the maximum number of error entries to keep.voidsetStackTraceEnabled(boolean stackTraceEnabled) Sets whether to capture stack traces.voidsetTimeToLive(Duration timeToLive) Sets the time-to-live for error entries.Methods inherited from interface org.apache.camel.spi.ErrorRegistryView
browse, browse, clear, size
-
Method Details
-
forRoute
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
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.
-