Skip to content

Latest commit

 

History

History

discoveries

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Discoveries

This is a simple sample that illustrates how to develop a custom service type for the Vert.x Service Discovery:

  • discoveries-service-type declares a HelloType and start a verticle that registers the HelloService into the Vert.x Service Discovery

  • discoveries-consumer start a verticle that calls the Vert.x Service Discovery to get the HelloService and calls this one.

 Run the examples with maven

mvn clean install
cd discoveries-service-type
mvn clean vertx:run -Dvertx.runArgs="-cluster" -Dvertx.jvmArguments="-Djava.util.logging.config.file=logging.properties"

Open another terminal:

cd discoveries-consumer
mvn clean vertx:run -Dvertx.runArgs="-cluster" -Dvertx.jvmArguments="-Djava.util.logging.config.file=logging.properties"

Run the examples with an IDE

discoveries-service-type

Create a Run configuration for the project discoveries-service-type with the following configuration:

  • Main class: io.vertx.core.Launcher

  • VM options: -Djava.util.logging.config.file=src/main/resources/logging.properties

  • Program arguments: run org.ws13.howtos.vertx.discoveries.hello.HelloPublisherVerticle -cluster

  • Use of classpath module: discoveries-service-type

The VM option switch off the verbosity of the Cluster library Ignite

discoveries-consumer

Create a Run configuration for the project discoveries-consumer with the following configuration:

  • Main class: io.vertx.core.Launcher

  • VM options: -Djava.util.logging.config.file=src/main/resources/logging.properties

  • Program arguments: run org.ws13.howtos.vertx.discoveries.hello.consumer.HelloConsumerVerticle -cluster

  • Use of classpath module: discoveries-consumer

The VM option switch off the verbosity of the Cluster library Ignite

Run the discoveries-service-type first since the HelloService is used by discoveries-consumer at startup.