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.
This sample is part of a blog post Implementing a custom Service Type for the Vert.x Service Discovery
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"
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
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.