Search code examples
vert.xvertx-eventbus

Vertx eventbus and verticle instances


We currently using 2 instances per verticle for our scaling needs, i just had a query regarding the evenBus publish.

If the eventBus publishes a message does this message get delivered to N instances of the verticle deployed?

DeploymentOptions().setInstances(2)
vertx.eventBus().publish("/event", Json.encodeToBuffer(message));


Solution

  • Since your question is very short, I'll be very short too:

    eventBus.publish() delivers the message to all listeners.

    eventBus.send() delivers the message to a single listener.