Versions Compared

Key

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

...

  • all Camel events extend java.util.EventObject resp. org.apache.camel.management.event.AbstractExchangeEvent. There are many events already defined in Camel, e.g. ExchangeCompletedEventExchangeFailedEventExchangeSendingEvent etc. These events are generated automatically by Camel.
  • if you want to catch these events then you have to implement EventNotifier interface and this notifier add to Camel context. It's possible to use method addEventNotifier in class AbstractBasicRoute for our routes.

Usage example: http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.htmlEventNotifier to log details about all sent Exchanges

 

There are new events defined in CleverBus which OpenHub framework which can be caught anywhere by EventNotifier:

...

Info

There was discussion if use Spring or Camel events. Finally we use Camel events because we use native support in Camel with lot of predefined events and Spring framework is only one implementation of bean registry and therefore we didn't want to be dependant on specific implementation.

Usage

There is @EventNotifier annotation that marks classes which implement org.apache.camel.spi.EventNotifier interface for listening to Camel events.

...