Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Well, this is really a "chicken or the egg" question. The Camel error handler (e.g., in the routes) only applies when a message is being routed by the routing engine.
Before this happens, a consumer must successfully receive a message, create a Camel Exchange, populate the Exchange with message details (e.g., body and headers), and then pass the Exchange to the routing engine. Only at this point can the routing error handler deal with exceptions occurring. Before this point, any error handling is really Component-specific.

Info
titleBridge with error handler

From Camel 2.10 onwards the file and ftp consumers can now bridge to the Camel routing engine's error handler. See more details at the consumer.bridgeErrorHandler option on the File documentation.

If the component consumer extends the DefaultConsumer from Camel, then it offers an org.apache.camel.spi.ExceptionHandler hook for end users to plug-in a custom strategy. The default implementation from Camel is LoggingExceptionHandler that will log the exception at ERROR/WARN level, and then ignore the exception.

...