2

I've two separate verticles in two projects which are packaged as regular jar. The verticles types is standard. The first verticle send message over a rest endpoint by eventbus.send method. The other verticle receive that message(actually should take but fail) by eventbus.consumer method.

I created the jars by maven shade plugin and I run with -cluster parameter. Both projects have hazelcast dependency and i see in the console log that the hazelcast cluster up

When the verticles are in the same jar the receiver verticle is receiving messages.

Sender

EventBus eventBus = vertx.eventBus();
String message = routingContext.request().getParam("param");
eventBus.send("address", message, reply -> {
   if (reply.succeeded()) {
      System.out.println("Received reply: " + reply.result().body());
   } else {
      System.out.println("No reply");
   }
});

Receiver

@Override
public void start() throws Exception {

    EventBus eventBus = vertx.eventBus();
    eventBus.consumer("address", message -> {
        System.out.println("Message: " + message.body());
        receivedMessage.reply("message received");
    });

    System.out.println("Receiver ready!");
}

What is wrong, any idea?

EDIT

The problem solved when I add cluster.xml to both applications.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • What is your main method? Do you create clustered vertx or use a launcher? – ledniov Jul 20 '18 at 07:07
  • I'm using launcher. I found the source of the problem. I came to share and I see your comment. The problem solved when I add cluster.xml to both applications. Thanks. – Rain Fitzgerald Jul 20 '18 at 08:08

0 Answers0