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.