build(distro-vertx) Async log4j2 config & shell script for starting gateway with sensible defaults.
MODIFY
common/logging/log4j2/pom.xml
common/logging/log4j2/pom.xml
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
+ <!-- For async logging (recommended) -->
+ <dependency>
+ <groupId>com.lmax</groupId>
+ <artifactId>disruptor</artifactId>
+ </dependency>
</dependencies>
</project>

MODIFY
distro/vertx/src/main/assembly/overlay.xml
distro/vertx/src/main/assembly/overlay.xml
<includes>
<include>*</include>
</includes>
- <!-- <outputFileNameMapping>apiman-gateway-platforms-vertx3-fat.jar</outputFileNameMapping> -->
+ <outputFileNameMapping>apiman-gateway-vertx.jar</outputFileNameMapping>
<useProjectArtifact>true</useProjectArtifact>
<useProjectAttachments>true</useProjectAttachments>
<useTransitiveDependencies>false</useTransitiveDependencies>

ADD
distro/vertx/src/main/resources/overlay/apiman-gateway.sh
+#!/bin/sh
+
+# Convenience script to launch apiman's Vert.x gateway with sensible
+# default behaviour.
+# To pass additional Java options with $APIMAN_GATEWAY_OPTS.
+# e.g. export APIMAN_GATEWAY_OPTS="-Xmx2048".
+
+# Some elements cribbed from WF's `standalone.sh`; thanks.
+DIRNAME=$(dirname "$0")
+# PROGNAME=$(basename "$0")
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+ if [ "x$JAVA_HOME" != "x" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+ else
+ JAVA="java"
+ fi
+fi
+
+# Launch
+$JAVA $APIMAN_GATEWAY_OPTS -Dlog4j.configurationFile="$DIRNAME/log4j2.xml" \
+ `# Set Vert.x's logger to use Log4j2 (NB: this is separate from apiman's policy/internal logging).` \
+ -Dvertx.logger-delegate-factory-class-name=io.apiman.gateway.platforms.vertx3.logging.ApimanLog4j2LogDelegateFactory \
+ `# Async Log4j2 logging using LMAX Disruptor.` \
+ -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector \
+ `# $@ to pass args through.` \
+ -jar "$DIRNAME/apiman-gateway-vertx.jar" "$@"

ADD
distro/vertx/src/main/resources/overlay/log4j2.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Ensure you set the system property to make all loggers asynchronous.
+-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
+This is done automatically if you are using the provided shell script.
+
+See more detail at: https://logging.apache.org/log4j/2.x/manual/async.html
+-->
+<Configuration status="WARN">
+ <Appenders>
+ <!-- Async Loggers will auto-flush in batches, so switch off immediateFlush. -->
+ <RandomAccessFile name="RandomAccessFile" fileName="apiman-gateway.log" immediateFlush="false" append="false">
+ <PatternLayout>
+ <Pattern>%d %p %c{1.} [%t] %m %ex%n</Pattern>
+ </PatternLayout>
+ </RandomAccessFile>
+ <Console name="Console-Appender" target="SYSTEM_OUT" immediateFlush="false">
+ <PatternLayout>
+ <pattern>
+ [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
+ </pattern>>
+ </PatternLayout>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <!-- apiman package only logging -->
+ <AsyncLogger level="info" name="io.apiman" additivity="false">
+ <AppenderRef ref="RandomAccessFile"/>
+ <AppenderRef ref="Console-Appender"/>
+ </AsyncLogger>
+ <!-- You can add your own loggers with separate levels, etc. -->
+ <!-- <AsyncLogger level="info" name="com.example.yourpackage" additivity="false">
+ <AppenderRef ref="RandomAccessFile"/>
+ <AppenderRef ref="Console-Appender"/>
+ </AsyncLogger> -->
+ <!-- Root/Global file logging config -->
+ <AsyncRoot level="info" includeLocation="false">
+ <AppenderRef ref="RandomAccessFile"/>
+ </AsyncRoot>
+ <!-- Root/Global console logging config -->
+ <AsyncRoot level="info">
+ <AppenderRef ref="Console-Appender"/>
+ </AsyncRoot>
+ </Loggers>
+</Configuration>

MODIFY
pom.xml
pom.xml
<!-- Dependency Versions -->
<version.com.fasterxml.jackson>2.5.4</version.com.fasterxml.jackson>
<version.com.h2database>1.3.173</version.com.h2database>
+ <version.com.lmax>3.2.0</version.com.lmax>
<version.com.squareup.okhttp>2.4.0</version.com.squareup.okhttp>
<version.com.squareup.okio>1.4.0</version.com.squareup.okio>
<version.com.unboundid.unboundid-ldapsdk>3.0.0</version.com.unboundid.unboundid-ldapsdk>
<artifactId>hazelcast</artifactId>
<version>${version.com.hazelcast}</version>
</dependency>
-
+ <dependency>
+ <groupId>com.lmax</groupId>
+ <artifactId>disruptor</artifactId>
+ <version>${version.com.lmax}</version>
+ </dependency>
<!-- Spec Libraries -->
<dependency>
<groupId>javax.json</groupId>

build(distro-vertx) Async log4j2 config & shell script for starting gateway with sensible defaults.