0

As I read, there are two types of clustering: horizontal and vertical.

I am trying vertical clustering with vertx.io.

I have two vertx applications running on two different machines. One application creates a TCP server while other application creates a HTTP server. Now I want to publish some messages on event bus that should be listen by vertical running TCP server.

I follow the these steps from vertx. I am not able to listen to messages published by the HTTP server on even bus.

Is vertical scaling supported by Vertx?

Adam Michalik
  • 9,678
  • 13
  • 71
  • 102
Deepak Agrawal
  • 1,301
  • 5
  • 19
  • 43

1 Answers1

0

Run the applications with -cluster option like on first machine,

java -jar create-http-server-fat.jar -cluster

and on the other,

java -jar create-tcp-server-fat.jar -cluster

Then, your eventbuses will be able to communicate. Ensure that both the machines are connected via the same network.

-cluster : This option determines whether the Vert.x instance will attempt to form a cluster with other Vert.x instances on the network. Clustering Vert.x instances allows Vert.x to form a distributed event bus with other nodes. Default is false (not clustered).

Important : You need to have vertx-hazelcast-3.0.0 jar added to your classpath.