...
The error handler is scoped as either
- global
- per route
The following example shows how you can register a global error handler (in this case using the logging handler)
...
The error handler can be configured as a spring bean and scoped in:
- global (the camelContext tag)
- per route (the route tag)
- or per policy (the policy/transacted tag)
The error handler is configured with the errorHandlerRef
attribute.
...
The transactional error handler is based on spring transaction. This requires the usage of the camel-spring component.
See Transactional Client that has many samples for how to use and transactional behavior and configuration with this error handler.
See also
- Error handling in Camel for introduction and background material on error handling in Camel
- Dead Letter Channel for the dead letter error handler
- DefaultErrorHandler for the default error handler in Camel
- TransactionErrorHandler for the default error handler for transacted routes
- Transactional Client for transactional behavior
- Exception Clause as it supports handling thrown exceptions
- Try Catch Finally for try ... catch ... finally as DSL you can use in the routing