Example usage for io.vertx.core.dns DnsClient resolveMX

List of usage examples for io.vertx.core.dns DnsClient resolveMX

Introduction

In this page you can find the example usage for io.vertx.core.dns DnsClient resolveMX.

Prototype

@Fluent
DnsClient resolveMX(String name, Handler<AsyncResult<List<MxRecord>>> handler);

Source Link

Document

Try to resolve the MX records for the given name.

Usage

From source file:examples.DNSExamples.java

License:Open Source License

public void example8(Vertx vertx) {
    DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
    client.resolveMX("vertx.io", ar -> {
        if (ar.succeeded()) {
            List<MxRecord> records = ar.result();
            for (MxRecord record : records) {
                System.out.println(record);
            }/*w ww  .  j ava  2  s.  c  o  m*/
        } else {
            System.out.println("Failed to resolve entry" + ar.cause());
        }
    });
}