Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/config-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This section can be extended against standard [Spring configuration](https://doc
This parameter exists to allow to change the location of the directory Vert.x will create because it will and there is no way to make it not.
- `vertx.init-timeout-ms` - time to wait for asynchronous initialization steps completion before considering them stuck. When exceeded - exception is thrown and Prebid Server stops.
- `vertx.enable-per-client-endpoint-metrics` - enables HTTP client metrics per destination endpoint (`host:port`)
- `vertx.round-robin-inet-address` - enables round-robin inet address selection of the ip address to use

## Server
- `server.max-headers-size` - set the maximum length of all headers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.dns.AddressResolverOptions;
import io.vertx.core.file.FileSystem;
import io.vertx.ext.dropwizard.DropwizardMetricsOptions;
import io.vertx.ext.dropwizard.Match;
Expand All @@ -23,7 +24,9 @@ public class VertxConfiguration {
@Bean
Vertx vertx(@Value("${vertx.worker-pool-size}") int workerPoolSize,
@Value("${vertx.enable-per-client-endpoint-metrics}") boolean enablePerClientEndpointMetrics,
@Value("${metrics.jmx.enabled}") boolean jmxEnabled) {
@Value("${metrics.jmx.enabled}") boolean jmxEnabled,
@Value("${vertx.round-robin-inet-address}") boolean roundRobinInetAddress) {

final DropwizardMetricsOptions metricsOptions = new DropwizardMetricsOptions()
.setEnabled(true)
.setJmxEnabled(jmxEnabled)
Expand All @@ -32,10 +35,14 @@ Vertx vertx(@Value("${vertx.worker-pool-size}") int workerPoolSize,
metricsOptions.addMonitoredHttpClientEndpoint(new Match().setValue(".*").setType(MatchType.REGEX));
}

final AddressResolverOptions addressResolverOptions = new AddressResolverOptions();
addressResolverOptions.setRoundRobinInetAddress(roundRobinInetAddress);

final VertxOptions vertxOptions = new VertxOptions()
.setPreferNativeTransport(true)
.setWorkerPoolSize(workerPoolSize)
.setMetricsOptions(metricsOptions);
.setMetricsOptions(metricsOptions)
.setAddressResolverOptions(addressResolverOptions);

final Vertx vertx = Vertx.vertx(vertxOptions);
logger.info("Native transport enabled: {}", vertx.isNativeTransportEnabled());
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vertx:
uploads-dir: file-uploads
init-timeout-ms: 5000
enable-per-client-endpoint-metrics: false
round-robin-inet-address: false
server:
max-initial-line-length: 8092
max-headers-size: 16384
Expand Down
Loading