Versions Compared

Key

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

...

The event system in Motech provides a nice of pub/sub communications. Regular Spring beans can have methods annotated with the '@MotechListener' annotation. These are automatically picked up at startup and registered with the event system as listeners for a particular subjects. All events going through the event queue/topic are then forwarded to the appropriate listeners for handling. Launching an event is as easy as creating an object with a String subject and optionally a key-value map of parameters. An event relayed through the Motech event system is then passed to all its listeners (depending on whether a queue or topic is used, the event can go to all or a single Motech instance in a cluster, which provides a nice way of scaling). The event system also deals with retries and error handling.

...