-
Notifications
You must be signed in to change notification settings - Fork 15
Concepts
This page explains the main concepts of Mokai.
Messages carry information from applications to connections - and viceversa. They are a normalized representation of data that is flowing through Mokai (i.e. a format that is understood by all the components inside Mokai). For example, when a Jetty Connector receives an HTTP request, it creates a Message object with the HTTP query parameters so that other components inside Mokai (internal routers, actions, acceptors, connectors, etc.) can interact with it.
Getting into the deep technical details, a Message is a Java object with a Map of properties. Messages are created by connectors (e.g. when the Jetty Connector receives an HTTP request) and routed inside Mokai.
Connectors implement a specific protocol or technology for sending/receiving messages to/from applications and connections (e.g. HTTP, SMPP, JMS, etc.). Some connectors only send messages, others only receive them, and others do both. For instance:
- The Jetty Connector only receives messages - through the HTTP protocol -.
- The HTTP Connector only sends messages - through the HTTP protocol - .
- The SMPP Connector sends and receives messages to and from an SMSC - using the SMPP protocol -.
Acceptors are used to decide how messages received by an application are routed to the connections - and viceversa. When you configure a connector that is capable of sending messages, you define one or multiple acceptors that decide which messages are going to be processed by that connector. See Message Routing Example
Actions allow you to transform a message or to execute some other functionality (e.g. doing some validation, calling an external service, etc) at three specific points: after the message is received by a connector, before it is processed by a connector or after it is processed by a connector. See Configuring Actions Example