As mentioned in the previous article, Vert.x is an event-driven, non-blocking toolkit. It was designed for asynchronous communications. In most cases, you need to work with multiple verticles in your applications. You also need communication between these verticles in these cases. In this article, I will attempt to explain how you can do this — let’s get started!

Use of Multiple Verticles

An important note to remember is that a verticle is a unit of deployment. It allows you to encapsulate your code for different needs. In addition, they can be run independently of each other. Verticles are communicated with each other by sending messages on the event bus. For this example, we have developed two verticles. One is the sender and the other is the receiver. You can access code for this example from this repository. The start method in the SenderVerticle class is as follows:

Source de l’article sur DZONE

0 réponses

Laisser un commentaire

Participez-vous à la discussion?
N'hésitez pas à contribuer!

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.