Book Image

Mastering Apache Camel

By : Bilgin Ismet Ibryam, Jean Baptiste Onofre, Jean-Baptiste Onofré
5 (1)
Book Image

Mastering Apache Camel

5 (1)
By: Bilgin Ismet Ibryam, Jean Baptiste Onofre, Jean-Baptiste Onofré

Overview of this book

Table of Contents (15 chapters)
Mastering Apache Camel
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Error handlers scopes


An error handler can be defined:

  • At the Camel Context level (Camel Context scope), which means that all routes in this Camel Context will use this error handler.

  • At the route level (route scope), possibly overwritten the error handler defined using the Camel Context scope.

Thanks to the scope, it's possible to define a default error handler (Camel Context scope), and, possibly define an error handler specific to one particular route.

For instance, the following Blueprint XML contains two routes with two different error handlers—one with the Camel Context scope and another with route scope.

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

  <bean id="checker" class="com.packt.camel.chapter7e.Checker"/>

  <camelContext xmlns="http://camel.apache.org/schema/blueprint" errorHandlerRef="deadLetterErrorHandler">
      <errorHandler id="noErrorHandler" type="NoErrorHandler"/>
      <route&gt...