Skip to content

Instantly share code, notes, and snippets.

@cobratbq
Last active September 2, 2015 17:49
Show Gist options
  • Save cobratbq/418d38101622e35b39ff to your computer and use it in GitHub Desktop.
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 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