Vertx Eventbus not working in Java

后端 未结 2 1770
孤城傲影
孤城傲影 2021-01-14 03:54

OS Linux JDK 1.7.0_67 Vert.x 2.1.5

Just getting started for wiring some of the vertx examples found on github.

Due to the manual want to try out a simple Sen

相关标签:
2条回答
  • 2021-01-14 04:08

    The way you're running the vertices, they won't be able to see each other. They're essentially being started as completely separate processes with clustering disabled (the default). You have to run the vertices in cluster mode in order to get them to locate and communicate with one another. Use the -cluster option to enable Hazelcast clustering. You may also want to specify -host or -port.

    If you continue seeing problems with even bus communication after that, enable Hazelcast logging and ensure the two nodes see each other. You may have to alter cluster.xml (the Hazelcast configuration) if your network does not support multicast.

    0 讨论(0)
  • 2021-01-14 04:13

    Might be helpful for those who is using programmatic way of clustering. Please check you have the following values set in your vertx options:

    VertxOptions options = new VertxOptions().setClustered(true)
                    .setClusterHost("198.12.12.12")
                    .setHAEnabled(true)
                    .setHAGroup("dev");
    
     Vertx.clusteredVertx(options, res -> System.out.println(res.succeeded()));
    
    0 讨论(0)
提交回复
热议问题