This project shows a simple example using the Infinispan cluster manager (instead of the Hazelcast cluster manager).
This project is composed by three small applications:
-
Stats Producer App - sending stats data on the event bus
-
Stats Consumer App - consumes stats data from the event bus, adds the value to the global stats counter
-
Display Stats App - displays the value of the global stats periodically
Start these applications from your IDE, and you should see the sent and receive data (don’t forget to start the 3 of them application).
You can start more than one StatsConsumerApp and see how the counter is incremented atomically
The applications try to pick the network address automatically, but it may be wrong. In this case pass the IP of the interface you want to use as parameter.
you can launch the producer and consumer as follows:
mvn clean package java -jar target/infinispan-examples-3.5.1-fat.jar run io.vertx.example.infinispan.StatsProducerApp -cluster java -jar target/infinispan-examples-3.5.1-fat.jar run io.vertx.example.infinispan.StatsConsumerApp -cluster java -jar target/infinispan-examples-3.5.1-fat.jar run io.vertx.example.infinispan.DisplayStatsApp -cluster