Last active
September 2, 2015 17:49
-
-
Save cobratbq/418d38101622e35b39ff to your computer and use it in GitHub Desktop.
Implementation PingVerticle as provided by Vert.x as an example for integration testing. (See https://github.com/vert-x/vertx-maven)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a simple Java verticle which receives `ping` messages on the event bus and sends back `pong` replies | |
*/ | |
public class PingVerticle extends Verticle { | |
public void start() { | |
vertx.eventBus().registerHandler("ping-address", new Handler<Message<String>>() { | |
@Override | |
public void handle(Message<String> message) { | |
message.reply("pong!"); | |
container.logger().info("Sent back pong"); | |
} | |
}); | |
container.logger().info("PingVerticle started"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment