Business Events | Mendix

Skip to main content

Business Events

What Are Business Events?

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.

What is the Mendix Event Broker?

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.

What Standards Are Business Events Based On?

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.

Are Business Events Discoverable in the Mendix Catalog?

Yes, when you deploy a mendix app that defines a Business Event service, its AsyncAPI contract will be registered in the Catalog. Events can be curated in the Catalog, and developers can search and discover events when using the Catalog. This is also integrated into the integration pane in Studio Pro meaning that developers can discover events used in your organization’s Mendix landscape from Studio Pro. When a developer has found the desired Business Event using it in a Mendix project is a matter of dragging and dropping the event on a domain model.

Can Business Events Only Be Used for Subscribing to Notifications?

No, an application defining Business Events can define if other apps can subscribe to these events, or can publish these events, or both. Image an application that wishes to receive audit information from all other Mendix apps. It can define an audit event with a standardized structure, and specify that other apps can publish this event. Now any app can simply publish this predefined Business Event to inform the audit app of an auditable event.

Do I Need to Rearchitect All my Apps to Benefit from an Event Driven Architecture?

No, Business Event have been designed to also be useful in combination with traditional API approach. A common problem with API based integration is the lack of real time notifications. Applications that need to know if something happened in another app will frequently ask the source application if anything changed. This adds an overhead on the source application, so the number of times an application can ask is often limited, but this also impact the speed with which application can be informed about changes.

Business Events provide a better alternative to this recurrent polling: source application will sent a Business Event when something has changed, all apps interested can subscribe to this event and use the APIs to receive details of the change.

How Can I Send and Receive Business Events to Non-Mendix Systems?

In the Event Broker you can configure a bridge. This bridge will exchange events between the Mendix Event Broker and external software. Two options are currently available, the SQS Bridge and the HTTP bridge. The SQS bridge allows you to send and receive events from an AWS SQS queue. The HTTP bridge allows applications to send events to the Event Broker by doing a rest call the the HTTP bridge API of the Event Broker.

How Can I Control which Applications Can Send and Receive Business Events?

In the Mendix Event Broker Dashboard, you can specify which applications can send and receive registered Business Events.

Where Can I Get More Information or Provide Feedback?

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.

Choose your language