As a second example, let's show off a bit of what event bus can do. This is a TCP server that fans out messages received from one client to the rest of the connected clients.
This is an event bus-based variation of the classic "fan out" example that can be found in official documentation of Vert.x. The original example keeps a set of client sockets (one for every connected client) and iterates over them every time a new message is received. With this one however, we will demonstrate how the publish-subscribe feature offered by this framework, keeps the code simple by saving the hassle to keep updated and iterate over a set of client sockets.