Request Handlers

A handler is a Java or Kotlin class implementing the RequestHandler interface. Handlers are registered via the @Handler annotation, and they're invoked when an external message is received that matches the path annotation parameter.

Request Matching

Incoming requests are matched against potential handlers per two possible routing patterns:

Base Handlers

Typically a request handler will interpret the message payload and do one of the following: Handlers commonly may perform other tasks as well: MDW provides the BaseHandler, implementation with helper methods for performing the tasks listed above. Also, there are specialized base classes to extend for running or notifying processes:

Creating a Handler

To create a RequestHandler implementation in MDW Studio, right-click on a package name in the Project tool window, and select New > MDW Handler.

Old-style .evth Assets

Previously MDW used .evth assets to register handlers. This type of asset is now deprecated and replaced by the RequestHandler mechanism described above. The CLI provides a convert command that can create a RequestHandler from an evth asset:
  mdw convert --input=assets/com/example/request/MyOldEventHandler.evth