Skip to content

Instantly share code, notes, and snippets.

@teivah
Created May 30, 2018 13:45
Show Gist options
  • Save teivah/2f436dee9b726d0ebe39fc20edb135b5 to your computer and use it in GitHub Desktop.
Save teivah/2f436dee9b726d0ebe39fc20edb135b5 to your computer and use it in GitHub Desktop.
vertx.deployVerticle("org.enterpriseintegration.Worker",
// Instantiate a DeploymentOptions by setting an explicit number
// of instances and enabling worker code
new DeploymentOptions().setInstances(instances).setWorker(true), res -> {
if (res.succeeded()) {
System.out.println("Worker verticle deployed");
// Send messages on the event bus
EventBus eventBus = vertx.eventBus();
eventBus.publish("event", "event01");
eventBus.send("event", "event02");
eventBus.send("event", "event03");
} else {
System.out.println("Error while deploying a verticle: " + res.cause().getMessage());
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment