This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void start(Future<Void> startFuture) { | |
//Retrieve the EventBus object form the vertx one | |
EventBus eventBus = vertx.eventBus(); | |
//Create a EventBus consumer and instantiate a JsonObject type message consumer | |
MessageConsumer<JsonObject> createConsumer = eventBus.consumer("customer.create"); | |
//Handle new messages on customer.create endpoint | |
createConsumer.handler(json -> { | |
System.out.println("Received new customer: " + json.body()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventBus eventBus = vertx.eventBus(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void start(Future<Void> startFuture) { | |
//Retrieve the EventBus object form the vertx one | |
EventBus eventBus = vertx.eventBus(); | |
//Create a EventBus consumer and instantiate a JsonObject type message consumer | |
MessageConsumer<JsonObject> createConsumer = eventBus.consumer("customer.create"); | |
//Handle new messages on customer.create endpoint | |
createConsumer.handler(json -> { | |
System.out.println("Received new customer: " + json.body()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageConsumer<JsonObject> createConsumer = eventBus.consumer("customer.create"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createConsumer.handler(json -> { | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eventBus.publish("customer.completion", enrichedCustomer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vertx.deployVerticle("org.enterpriseintegration.Standard", | |
// Instantiate a DeploymentOptions by setting an explicit number | |
// of instances and referencing a JSON configuration | |
new DeploymentOptions().setInstances(instances).setConfig(config), res -> { | |
if (res.succeeded()) { | |
System.out.println("Standard verticle deployed"); | |
// Send messages on the event bus | |
EventBus eventBus = vertx.eventBus(); | |
eventBus.publish("event", "event01"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vertx.deployVerticle("org.enterpriseintegration.MTWorker", | |
// Instantiate a DeploymentOptions by setting an explicit number | |
// of instances and enabling worker code, multiThreaded mode but | |
// without having to set the number of instances | |
new DeploymentOptions().setWorker(true).setMultiThreaded(true), res -> { | |
if (res.succeeded()) { | |
System.out.println("Multi-threaded Worker verticle deployed"); | |
// Send messages on the event bus | |
EventBus eventBus = vertx.eventBus(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gosiris.InitActorSystem(gosiris.SystemOptions{ | |
ActorSystemName: "ActorSystem", | |
}) | |
defer gosiris.CloseActorSystem() |