Error Registry
The ErrorRegistry SPI captures snapshots of exceptions that occur during message routing, without retaining references to the original exchange or exception objects.
When enabled, the registry stores error snapshots including the exception type, message, stack trace, and message history (the trace of every node the message was routed through). Error entries can be browsed globally or scoped to a specific route.
Enabling
The error registry is disabled by default (opt-in). It can be enabled via Java:
context.getErrorRegistry().setEnabled(true); Or via configuration properties:
camel.main.errorRegistryEnabled = true Configuration
| Option | Default | Type | Description |
|---|---|---|---|
|
| boolean | Whether the error registry is enabled. |
|
| int | Maximum number of error entries to keep. When exceeded, the oldest entries are evicted. |
|
| int | Time-to-live for error entries in seconds. Entries older than this are evicted. |
|
| boolean | Whether to capture stack traces. |
Message History
When Message History is enabled on the CamelContext, the error registry also captures the message history trace for each error. This shows every node the message was routed through up until the point of failure, which is very useful for debugging.
Dev Console
A dev console named errors is available for browsing captured errors.
Options:
-
routeId— filter by route id -
limit— limit the number of entries displayed -
stackTrace— set totrueto include stack traces in the output (stack traces are captured by default but not displayed unless this option is set, to keep the output concise)