feat(gateway-vertx) "auto" selects number of verticles to deploy at startup.
MODIFY
distro/vertx/src/main/resources/overlay/configs/conf-es.json
distro/vertx/src/main/resources/overlay/configs/conf-es.json
"logger-factory": {
"class": "io.apiman.gateway.platforms.vertx3.logging.VertxLoggerDelegate",
- "config": {
-
- }
+ "config": {}
},
// Elasticsearch Metrics Settings
// Verticle configuration
// Port - The port a given verticle listens on (where relevant)
- // Count - Number of given verticle type launched
+ // Count - Number of given verticle type launched, or "auto" for automatic.
"verticles": {
"http": {
"port": 8082,
- "count": 1
+ "count": "auto"
},
// Configure the following SSL section to enable SSL/TLS.
"https": {

MODIFY
distro/vertx/src/main/resources/overlay/configs/conf-headless.json
distro/vertx/src/main/resources/overlay/configs/conf-headless.json
"config": {}
},
+ "logger-factory": {
+ "class": "io.apiman.gateway.platforms.vertx3.logging.VertxLoggerDelegate",
+ "config": {}
+ },
+
// Elasticsearch Metrics Settings
"metrics": {
"class": "io.apiman.gateway.engine.es.ESMetrics",
// Verticle configuration
// Port - The port a given verticle listens on (where relevant)
- // Count - Number of given verticle type launched
+ // Count - Number of given verticle type launched, or "auto" for automatic.
"verticles": {
"http": {
"port": 8082,
- "count": 1
+ "count": "auto"
},
// Configure the following SSL section to enable SSL/TLS.
"https": {
"port": 8443,
- "count": 0
+ "count": 0 // "auto"
},
// The Gateway API; this will be the port to set in the UI.
// e.g. http://localhost:8081 or https://gateway.machine:8081

MODIFY
gateway/platforms/vertx3/vertx3/examples/configs/conf-es.json
gateway/platforms/vertx3/vertx3/examples/configs/conf-es.json
"verticles": {
"http": {
"port": 8082,
- "count": 1
+ "count": "auto"
},
// Configure the following SSL section to enable SSL/TLS.
"https": {

MODIFY
gateway/platforms/vertx3/vertx3/examples/configs/conf-headless.json
gateway/platforms/vertx3/vertx3/examples/configs/conf-headless.json
"verticles": {
"http": {
"port": 8082,
- "count": 1
+ "count": "auto"
},
// Configure the following SSL section to enable SSL/TLS.
"https": {

MODIFY
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/common/config/VertxEngineConfig.java
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/common/config/VertxEngineConfig.java
@@ -263,6 +263,12 @@ public class VertxEngineConfig implements IEngineConfig {
}
public int getVerticleCount(VerticleType verticleType) {
+ // If the field is set as "auto", then number of verticles == number of cores
+ // TODO should be decent default choice, but should benchmark to find optimum.
+ // See: VertxOptions
+ if ("auto".equalsIgnoreCase(getVerticleConfig(verticleType.name()).getValue(VERTICLE_COUNT).toString())) {
+ return Runtime.getRuntime().availableProcessors();
+ }
return getVerticleConfig(verticleType.name()).getInteger(VERTICLE_COUNT);
}

feat(gateway-vertx) "auto" selects number of verticles to deploy at startup.