How to install Event Broker Tools | Mendix 10
An “Event Broker” is a mechanism that enables communication and the flow of events between different parts of an application or between different microservices in an event-driven architecture.
It plays a crucial role in building scalable and flexible applications, allowing different parts of the application to respond to events and interact with each other asynchronously.
Prerequisites to this tutorial
- Git Installed
https://git-scm.com/downloads
Attention!
- In order to be able to follow this tutorial, it is recommended to do the tutorial regarding Business Events first.
https://medium.com/@mendixwithme/how-to-use-business-events-mendix-10-219ca7759514
Step by Step
1º Install Visual Studio Code and Docker.
VSCode: https://code.visualstudio.com/download
Docker: https://www.docker.com/products/docker-desktop/
2º Access the “Event Broker Tools” page on GitHub and clone the repository by clicking on the “Code” button and copying the HTTPS link.
Github: https://github.com/mendix/event-broker-tools
Open a Git terminal inside the Mendix Folder and write “git clone https://github.com/mendix/event-broker-tools.git”. Press Enter and wait.
3º Open the Visual Studio Code.
4º Select the Extension tab on the Side Menu and Search for “Docker”. Select and install the Extension created by Microsoft.
5º After installation, restart the VSCode and Open the folder with the cloned repository.
6º On the right side, go to the “local-setup” folder and right-click on the “docker-compose.yml” file. Select the “Compose Up” option.
7º Go to the BusinessEvents3 project (Check the BusinessEvents tutorial if you don’t have this project) and click on “Settings”. Create a new configuration.
8º As a Name, write “BusinessEventLocalTest”. Under the tab “Constants”, add two new constants:
Name: BusinessEvents.ChannelName
Value: ‘local’
Name: BusinessEvents.ServerUrl
Value: ‘localhost:9092’ (Windows) or
‘YOUR-IPADDRESS:9094’ (Linux/MACOS)
9º Click to “Activate” the new configuration. Run the project locally.
10º Do the same to the second app. Go to the BusinessEvents4 project and click on “Settings”. Create a new configuration.
11º Write “BusinessEventLocalTest” and under the tab “Server” change the “Runtime port” to “8081” and “Admin port” to “8091”. We are changing this to make it possible to execute both applications at the same time.
12º Add two new constants:
Name: BusinessEvents.ChannelName
Value: ‘local’
Name: BusinessEvents.ServerUrl
Value: ‘localhost:9092’ (Windows) or
‘YOUR-IPADDRESS:9094’ (Linux/MACOS)
It is important to check if your new configuration is active.
13º Run the project.
14º Inside the VSCode, confirm if all the topics have “Created” or “Started” after it.
15º Create a new Order object, selecting “Pending” as the order status.
Create a new Shipping object with the same status.
16º Go back to the first application and change the “order status” to “Cancelled”. Return to the Shipping app and refresh the page. If everything went well, you should the “Shipping Status” as “Cancelled”
This is the end of the tutorial.
Read more
From the writer
If you enjoyed this article you can find more on our Medium page. For great videos, you can visit our YouTube page.
Are you interested in getting more involved with our community? Join us on our Discord Community Channel.
From the Publisher -
Inspired by this article to bring your ideas to life with Mendix? Sign up for a free account! You’ll get instant access to the Mendix Academy, where you can start building your skills.
For more articles like this one, visit our Medium page. And you can find a wealth of instructional videos on our community YouTube page.
Speaking of our community, join us in our Slack community channel. We’d love to hear your ideas and insights!