Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The Message Validation in µ² serves the validation of messages before sending to another target agent.
For implementation simply implement the MicroMessageValidator interface. It enforces the implementation of the validate() method which processes the MicroMessage and returns a boolean result indicating the validity of the message. Additionally the validate() method needs to react on the strength of validation. If the strictValidation variable (see MicroMessage) is set to true, the validator needs to implement the system reaction (e.g. RuntimeException).
An example for a validator which merely checks on the existence of the message field "TestedKey" is shown below.
The provided implementation is the DefaultMessageValidator which checks messages on the existence on sender field along with either recipient, intent or event field.
The activation of message filtering is described in the context of the MicroMessage documentation.
The message validator implementation used for validation is specified in the Platform Configuration as fully qualified Java class name.