Business events offer a high-available, near real-time, decoupled way to model and communicate events between Mendix applications based on open standards and industry standard messaging software.
Business events can be used by applications as a signal to notify other applications that something interesting has occurred. For example, if a customer places an order in a web shop, the web shop can signal this with a business event called New Order Placed. Any application can indicate that it wants to receive this event to handle follow-up actions in real time (for example, to send an invoice or handle packaging and logistics).
Business event services provide contracts that inform developers of client applications which events are available, and what these events look like. This contract is based on the open AsyncAPI format.
Business events are integrated into Mendix low-code development environment. Business Events including the information they provide are modeled in a Business event service. Business events can be published using a microflow activity. Business events are treated like data, which means you can retrieve published and received events like other entities. More importantly, publishing business events respects the error-handling facilities offered by Mendix. Events are only delivered to other applications if your microflow succeeds. If your microflow fails and your entity changes are rolled back, your published business events will also be rolled back and will not be delivered to the subscribed applications.
Business events can be bi-directional: a Business event services defines what an event looks like, but also if it is sent from the service to other applications, or that other applications can also send events to the service and other applications. If you have one service responsible for registering orders, you can specify that only that service will send New Order Created events. At the same time the service can also define an event that other applications can send when an order was shipped or billed.
Events are delivered and distributed by the Mendix Event Broker. Apps publishing events do not need to know who needs to receive events, and apps receiving events do not have to call the publishing app. The benefit of this is that events can be received and handled in near real-time, without the source application having to call all the individual interested parties.
The Mendix Event Broker leverages Kafka, which is a highly scalable and reliable component for delivering and processing event messages. Mendix ensures any low-code developer can benefit from this component by handling all the complexities in the platform. Developers can simply define a business event in their app’s domain model and then publish it in a microflow, and the platform will handle the communication logic. Alternatively, consuming app developers can simply subscribe microflows to business events, and the Mendix Platform will ensure these microflows are executed when the event gets published.
Business events are based on open standards that are integrated into the Mendix low-code platform. Open standards ensure that the Mendix Event Broker and Business Events will integrate well with non-Mendix components in your application landscape.
We use the following standards:
- CloudEvents is an open standard (backed by CNCF) which defines what messages technically look like when exchanged between applications.
- AsyncAPI is used to describe the business event services. AsyncAPI is an open standard for contracts describing message based services.
- Apache Kafka is the messaging infrastructure used within the Mendix Event Broker. Kafka is a proven and scalable event streaming platform.
Business events are publicly available in Mendix Studio Pro 9.18 as an out-of-the-box modeling capability in Studio Pro, supported by the Mendix Business Events module in the Mendix Marketplace. A free multi-tenant event broker is provided for apps deployed to the Mendix Cloud. To use Business Events on licensed nodes in the Mendix Cloud a separate event broker license can be purchased. For further information, see the Mendix Business events module documentation.