1
votes

im working with Vertx and HazelCast to distribute my Verticles about the network.

No I have the problem, that my co-worker also uses clustered verticles with HazelCastManager. Is there a possibility to avoid, that our verticles see each other to prevent by-effects?

3

3 Answers

4
votes

You can define Hazelcast Cluster Groups in your cluster.xml file. Here's the manual section related to it: http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#creating-cluster-groups

3
votes

If you use Multicast (default config) for discovery, you can redefine the groupname and password. Apart from that you can just choose any other option for discovery supported by the given Hazelcast version inside vert.x: http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#discovering-cluster-members

0
votes

Old question, but still valid, here's simple answer:

If you want to limit your vertx system to the single server, i.e. not have the eventbus leak out across your local network, the simplest thing to do is create a local copy of Hazelcast's cluster.xml on your classpath, i.e. copy/edit vertx source (see git):

vertx-hazelcast/src/main/resources/default-cluster.xml

into a new file in your vertx project

src/main/resources/cluster.xml

The required change is to the <multicast> stanza disabling that feature:

<hazelcast ...>
   ...
  <network>
      ...
    <join>
          ...
      <multicast enabled="false">
             ...
      </multicast>
      <tcp-ip enabled="true">
          <interface>127.0.0.1</interface>
      </tcp-ip>