/** * DNS Address resolver options where the max queries is increased to 10 to * support more environments. * * @return address resolver options */ @Bean public AddressResolverOptions addressResolverOptions() { return new AddressResolverOptions() .setMaxQueries(10); }
@Bean public VertxOptions vertxOptions(final AddressResolverOptions addressResolverOptions) { return new VertxOptions() .setAddressResolverOptions(addressResolverOptions) .setWarningExceptionTime(vertxWarningExceptionTime) .setWorkerPoolSize(vertxWorkerPoolSize); }
public static void main(String[] args) { setLoggingToSLF4J(); deployVerticle(vertx(new VertxOptions().setAddressResolverOptions(new AddressResolverOptions() .addServer("8.8.8.8") .addServer("8.8.4.4"))), new ServerVerticle(), new DeploymentOptions() .setConfig(getConfig(args))) .subscribe(ar -> log.info("Server up!"), thr -> log.error("Failed to start server", thr)); }
/** * Exposes a Vert.x instance as a Spring bean. * * @return The Vert.x instance. */ @Bean public Vertx vertx() { VertxOptions options = new VertxOptions() .setWarningExceptionTime(1500000000) .setAddressResolverOptions(new AddressResolverOptions() .setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately .setCacheMaxTimeToLive(0) // support DNS based service resolution .setRotateServers(true) .setQueryTimeout(DEFAULT_ADDRESS_RESOLUTION_TIMEOUT)); return Vertx.vertx(options); }
/** * Gets the singleton Vert.x instance to be used by Hono. * * @return the instance. */ @Bean public Vertx vertx() { VertxOptions options = new VertxOptions() .setWarningExceptionTime(1500000000) .setAddressResolverOptions(new AddressResolverOptions() .setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately .setCacheMaxTimeToLive(0) // support DNS based service resolution .setQueryTimeout(1000)); return Vertx.vertx(options); }
/** * Gets the singleton Vert.x instance to be used by Hono. * * @return the instance. */ @Bean public Vertx vertx() { VertxOptions options = new VertxOptions() .setWarningExceptionTime(1500000000) .setAddressResolverOptions(new AddressResolverOptions() .setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately .setCacheMaxTimeToLive(0) // support DNS based service resolution .setQueryTimeout(1000)); if (metricsOptions != null) { options.setMetricsOptions(metricsOptions); } return Vertx.vertx(options); }
Vertx vertx() { VertxOptions options = new VertxOptions() .setWarningExceptionTime(1500000000) .setAddressResolverOptions(new AddressResolverOptions() .setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately .setCacheMaxTimeToLive(0) // support DNS based service resolution .setRotateServers(true) .setQueryTimeout(DEFAULT_ADDRESS_RESOLUTION_TIMEOUT_MILLIS)); return Vertx.vertx(options); }
/** * Exposes a Vert.x instance as a Spring bean. * * @return The Vert.x instance. */ @Bean public Vertx vertx() { VertxOptions options = new VertxOptions() .setWarningExceptionTime(1500000000) .setAddressResolverOptions(new AddressResolverOptions() .setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately .setCacheMaxTimeToLive(0) // support DNS based service resolution .setQueryTimeout(1000)); if (metricsOptions != null) { options.setMetricsOptions(metricsOptions); } return Vertx.vertx(options); }
@Override protected VertxOptions getOptions() { return super.getOptions().setAddressResolverOptions(new AddressResolverOptions(). setHostsValue(Buffer.buffer( "127.0.0.1 somehost\n" + "127.0.0.1 localhost"))); }
private Cache(AddressResolverOptions options) { this.options = options; }