What is covered?

- Spring beans as Mule service component
- XML and custom transformers
- Chaining transformers
- Multiple outbound endpoints

Description

The error handler example demonstrates using Spring beans as Mule service component implementations and how to publish messages to multiple outbound endpoints.

Under the Hood

The sample consists of two services: ExceptionManager and BusinessErrorManager. The BusinessErrorManager is a simple service used to log a message to the console when a message is received. In this example, it is used to receive BusinessException message over JMS to simulate a real-world exception processing application. The ExceptionManager is a service that receives exception messages and performs some action depending on the type of exception. For example, if a fatal exception is received, an email is sent to the system administrator. If a standard system exception is received, it is logged to a file on the local file system. The purpose of this example isn't to implement an exception handler, but to demonstrate the following features:

- All the service components in the error handler are configured as Spring beans in the same Mule configuration file
- The error manager has multiple outbound endpoints configured on it, and the example demonstrates how to dispatch to different endpoints
- The messages in the system are Java objects and need to be converted to and from XML. The example demonstrates chaining multiple transformers together