vert.xvertx-verticlevertx-eventbus

message passing between 2 verticles under 2 different Vertx instances. Is it possible?


I'm trying to make communication possible between 2 verticles (X, Y) deployed using 2 different Vert.x instances.

X sends a message on "Address" eventbus().send("Address", message, replyHandler)

Is it possible for Y to listen on same address? eventbus().localConsumer("Address", eventHandler)


Solution

  • The EventBus is tied to a particular Vertx instance. So unless your two Vertx instances are part of the same cluster, there is no connection between their respective Event Buses.

    You could use an event bus bridge of some-kind (like this one) to make it look like you're directly communicating between them, though you may be better off just directly using some other protocol.