blob: 4013f6c7cd0d140d079c2535ddfe3e57c64f798c [file]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 2.0.0 from src/site/xdoc/docs/wildfly-http2-integration-guide.xml at 2026-05-18
| Rendered using Apache Maven Fluido Skin 2.0.0-M11
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0" />
<title>WildFly + Axis2 HTTP/2 Integration Guide – Apache Axis2</title>
<link rel="stylesheet" href="../css/apache-maven-fluido-2.0.0-M11.min.css" />
<link rel="stylesheet" href="../css/site.css" />
<link rel="stylesheet" href="../css/print.css" media="print" />
<script src="../js/apache-maven-fluido-2.0.0-M11.min.js"></script>
</head>
<body>
<div class="container-fluid container-fluid-top">
<header>
<div id="banner">
<div class="pull-left"><div id="bannerLeft"><h1><a href="https://www.apache.org/"><img class="class java.lang.Object" src="https://www.apache.org/images/asf_logo_wide.png" /> Apache Axis2</a></h1></div></div>
<div class="pull-right"><div id="bannerRight"><h1><a href="https://axis.apache.org/axis2/java/core/"><img class="class java.lang.Object" src="https://axis.apache.org/axis2/java/core/images/axis.jpg" /></a></h1></div></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate">Last Published: 2026-05-17<span class="divider">|</span>
</li>
<li id="projectVersion">Version: 2.0.1<span class="divider">|</span></li>
<li><a href="https://www.apache.org" class="externalLink">Apache</a><span class="divider">/</span></li>
<li><a href="../index.html">Axis2/Java</a><span class="divider">/</span></li>
<li class="active">WildFly + Axis2 HTTP/2 Integration Guide</li>
</ul>
</div>
</header>
<div class="row-fluid">
<header id="leftColumn" class="span2">
<nav class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Axis2/Java</li>
<li><a href="../index.html">Home</a></li>
<li><a href="../download.html">Downloads</a></li>
<li><a href="javascript:void(0)"><span class="icon-chevron-down"></span>Release Notes</a>
<ul class="nav nav-list">
<li><a href="../release-notes/1.6.1.html">1.6.1</a></li>
<li><a href="../release-notes/1.6.2.html">1.6.2</a></li>
<li><a href="../release-notes/1.6.3.html">1.6.3</a></li>
<li><a href="../release-notes/1.6.4.html">1.6.4</a></li>
<li><a href="../release-notes/1.7.0.html">1.7.0</a></li>
<li><a href="../release-notes/1.7.1.html">1.7.1</a></li>
<li><a href="../release-notes/1.7.2.html">1.7.2</a></li>
<li><a href="../release-notes/1.7.3.html">1.7.3</a></li>
<li><a href="../release-notes/1.7.4.html">1.7.4</a></li>
<li><a href="../release-notes/1.7.5.html">1.7.5</a></li>
<li><a href="../release-notes/1.7.6.html">1.7.6</a></li>
<li><a href="../release-notes/1.7.7.html">1.7.7</a></li>
<li><a href="../release-notes/1.7.8.html">1.7.8</a></li>
<li><a href="../release-notes/1.7.9.html">1.7.9</a></li>
<li><a href="../release-notes/1.8.0.html">1.8.0</a></li>
<li><a href="../release-notes/1.8.1.html">1.8.1</a></li>
<li><a href="../release-notes/1.8.2.html">1.8.2</a></li>
<li><a href="../release-notes/2.0.0.html">2.0.0</a></li>
<li><a href="../release-notes/2.0.1.html">2.0.1</a></li>
</ul></li>
<li><a href="../modules/index.html">Modules</a></li>
<li><a href="../tools/index.html">Tools</a></li>
<li class="nav-header">Documentation</li>
<li><a href="../docs/toc.html">Table of Contents</a></li>
<li><a href="../docs/installationguide.html">Installation Guide</a></li>
<li><a href="../docs/quickstartguide.html">QuickStart Guide</a></li>
<li><a href="../docs/userguide.html">User Guide</a></li>
<li><a href="../docs/jaxws-guide.html">JAXWS Guide</a></li>
<li><a href="../docs/pojoguide.html">POJO Guide</a></li>
<li><a href="../docs/spring.html">Spring Guide</a></li>
<li><a href="../docs/webadminguide.html">Web Administrator&apos;s Guide</a></li>
<li><a href="../docs/migration.html">Migration Guide (from Axis1)</a></li>
<li class="nav-header">Resources</li>
<li><a href="../faq.html">FAQ</a></li>
<li><a href="https://github.com/apache/axis-axis2-java-core" class="externalLink">Source Code</a></li>
<li class="nav-header">Get Involved</li>
<li><a href="../overview.html">Overview</a></li>
<li><a href="../mail-lists.html">Mailing Lists</a></li>
<li><a href="../release-process.html">Release Process</a></li>
<li><a href="../guidelines.html">Developer Guidelines</a></li>
<li><a href="../siteHowTo.html">Build the Site</a></li>
<li class="nav-header">Project Information</li>
<li><a href="https://github.com/apache/axis-axis2-java-core/graphs/contributors" class="externalLink">Contributors</a></li>
<li><a href="https://issues.apache.org/jira/projects/AXIS2/issues" class="externalLink">Issues</a></li>
<li class="nav-header">Apache</li>
<li><a href="https://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink">License</a></li>
<li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsorship</a></li>
<li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a></li>
<li><a href="https://www.apache.org/security/" class="externalLink">Security</a></li>
</ul>
</nav>
<div class="well sidebar-nav">
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<a href="https://maven.apache.org/" class="builtBy" target="_blank"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a>
</div>
</div>
</header>
<main id="bodyColumn" class="span10">
<section><a id="WildFly_.2B_Axis2_HTTP.2F2_Integration_Guide"></a>
<h1>WildFly + Axis2 HTTP/2 Integration Guide</h1>
<p><strong>Tested on:</strong> WildFly 32 (OpenJDK 17, 21) and WildFly 39
(OpenJDK 21, 25). Configuration examples below use WildFly 32 syntax;
WildFly 39 is compatible with the same configuration.</p>
<div style="background-color: #ffe8e8; border: 1px solid #ff4444; padding: 10px; margin: 10px 0;">
<section><section><section><a id="H2TransportSender_Configuration_.28Simplified_with_Intelligent_Defaults.29"></a>
<h4>H2TransportSender Configuration (Simplified with Intelligent Defaults)</h4>
<pre>
&lt;!-- Minimal HTTP/2 Transport - Intelligent Defaults Handle Optimization --&gt;
&lt;transportSender name=&quot;http&quot; class=&quot;org.apache.axis2.transport.h2.impl.httpclient5.H2TransportSender&quot;&gt;
&lt;parameter name=&quot;PROTOCOL&quot;&gt;HTTP/2.0&lt;/parameter&gt;
&lt;/transportSender&gt;
</pre>
</div>
</section></section></section><section><a id="WildFly_Server-Level_HTTP.2F2_Configuration_.28RECOMMENDED.29"></a>
<h2>WildFly Server-Level HTTP/2 Configuration (RECOMMENDED)</h2>
<div style="background-color: #e8f5e8; border: 1px solid #4CAF50; padding: 10px; margin: 10px 0;">
<strong>Key Optimizations:</strong>
<ul>
<li><strong>64KB Buffer/Flush Alignment</strong> - WildFly byte-buffer-pool and FlushingOutputStream flush interval are aligned at 64KB. This is a server-side serialization setting and is correct.</li>
<li><strong>HTTP/2 Flow-Control Windows</strong> - Sized for payload, not aligned to flush interval. See
<a href="http2-transport-additions.html#H2TransportSender">HTTP/2 Transport configuration</a>
for guidance on <code>initialWindowSize</code> tuning.</li>
<li><strong>Minimal Protocol Overhead</strong> - Single-layer HTTP/2 processing architecture</li>
<li><strong>Enhanced Monitoring</strong> - Built-in performance tracking and access logging</li>
</ul>
</div>
<div style="background-color: #fff8e1; border: 1px solid #f9a825; padding: 10px; margin: 10px 0;">
<strong>Important:</strong> The Axis2 transport's
<code>initialWindowSize</code> should <strong>not</strong> be set to
64KB to match the WildFly buffer pool or FlushingOutputStream flush
interval. The flow-control window and the server-side flush interval are
independent &#x2014; a 64KB window forces ~156 WINDOW_UPDATE round-trips for a
10MB response. Use at least 2MB for general traffic or 8MB for
large-payload workloads. See
<a href="http2-transport-additions.html#H2TransportSender">HTTP/2 Transport
&#x2014; Tuning for Different Workloads</a>.
</div>
<pre>
&lt;subsystem xmlns=&quot;urn:jboss:domain:undertow:14.0&quot;
default-virtual-host=&quot;default-host&quot;
default-servlet-container=&quot;default&quot;
default-server=&quot;default-server&quot;
statistics-enabled=&quot;${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}&quot;
default-security-domain=&quot;other&quot;&gt;
&lt;!-- MINIMAL WILDFLY HTTP/2 - Optimized Buffer Pool Configuration --&gt;
&lt;!-- Aligned with Enhanced Moshi H2 processing (64KB standard across all layers) --&gt;
&lt;!-- Reduces buffer fragmentation and improves memory efficiency --&gt;
&lt;byte-buffer-pool name=&quot;default&quot; buffer-size=&quot;65536&quot; max-pool-size=&quot;512&quot; direct=&quot;true&quot;/&gt;
&lt;!-- Single-Layer Buffer Cache - Optimized for JSON Processing --&gt;
&lt;!-- Aligned 64KB cache for consistent buffer management --&gt;
&lt;buffer-cache name=&quot;default&quot; buffer-size=&quot;65536&quot; buffers-per-region=&quot;64&quot;/&gt;
&lt;server name=&quot;default-server&quot;&gt;
&lt;!-- MINIMAL WILDFLY HTTP/2 - Optimized for Single-Layer Processing --&gt;
&lt;!-- Reduced protocol overhead, optimized for Enhanced Moshi H2 JSON processing --&gt;
&lt;http-listener name=&quot;default&quot; socket-binding=&quot;http&quot;
max-post-size=&quot;104857600&quot;
redirect-socket=&quot;https&quot;
enable-http2=&quot;true&quot;
http2-enable-push=&quot;false&quot;
http2-header-table-size=&quot;8192&quot;
http2-initial-window-size=&quot;2097152&quot;
http2-max-concurrent-streams=&quot;75&quot;
http2-max-frame-size=&quot;65536&quot;
http2-max-header-list-size=&quot;32768&quot;
max-connections=&quot;150&quot;
receive-buffer=&quot;4194304&quot;
send-buffer=&quot;2097152&quot;
no-request-timeout=&quot;300000&quot;
request-parse-timeout=&quot;60000&quot;
tcp-backlog=&quot;1024&quot;/&gt;
&lt;!-- MINIMAL WILDFLY HTTP/2 HTTPS - Aligned with HTTP configuration --&gt;
&lt;!-- SSL-optimized single-layer HTTP/2 processing --&gt;
&lt;https-listener name=&quot;https&quot; socket-binding=&quot;https&quot;
max-post-size=&quot;104857600&quot;
ssl-context=&quot;applicationSSC&quot;
enable-http2=&quot;true&quot;
http2-enable-push=&quot;false&quot;
http2-header-table-size=&quot;8192&quot;
http2-initial-window-size=&quot;2097152&quot;
http2-max-concurrent-streams=&quot;75&quot;
http2-max-frame-size=&quot;65536&quot;
http2-max-header-list-size=&quot;32768&quot;
max-connections=&quot;150&quot;
receive-buffer=&quot;4194304&quot;
send-buffer=&quot;2097152&quot;
no-request-timeout=&quot;300000&quot;
request-parse-timeout=&quot;60000&quot;
tcp-backlog=&quot;1024&quot;/&gt;
&lt;host name=&quot;default-host&quot; alias=&quot;localhost&quot;&gt;
&lt;!-- Enhanced Access Log for HTTP/2 Performance Monitoring --&gt;
&lt;access-log pattern=&quot;%h %l %u %t &quot;%r&quot; %s %b &quot;%{i,Referer}&quot; &quot;%{i,User-Agent}&quot; Cookie: &quot;%{i,COOKIE}&quot; Set-Cookie: &quot;%{o,SET-COOKIE}&quot; SessionID: %S Thread: &quot;%I&quot; TimeTaken: %T Protocol: %H Bytes: %B&quot;/&gt;
&lt;!-- HTTP/2 Performance Optimization Filters --&gt;
&lt;filter-ref name=&quot;gzip-compression&quot;/&gt;
&lt;filter-ref name=&quot;cache-control-headers&quot;/&gt;
&lt;/host&gt;
&lt;/server&gt;
&lt;!-- HTTP/2 Optimization Filters --&gt;
&lt;filters&gt;
&lt;!-- JSON compression for JSON-RPC / REST operations (30-50% reduction) --&gt;
&lt;gzip name=&quot;gzip-compression&quot;/&gt;
&lt;!-- Cache Control Headers for Static Resources --&gt;
&lt;response-header name=&quot;cache-control-headers&quot;
header-name=&quot;Cache-Control&quot;
header-value=&quot;public, max-age=2592000&quot;/&gt;
&lt;/filters&gt;
&lt;!-- MINIMAL WILDFLY HTTP/2 - Optimized Servlet Container --&gt;
&lt;!-- Enhanced for single-layer HTTP/2 and JSON processing --&gt;
&lt;servlet-container name=&quot;default&quot; default-buffer-cache=&quot;default&quot;
stack-trace-on-error=&quot;local-only&quot;
default-encoding=&quot;UTF-8&quot;&gt;
&lt;jsp-config development=&quot;false&quot; mapped-file=&quot;false&quot; check-interval=&quot;0&quot;
x-powered-by=&quot;false&quot; display-source-fragment=&quot;false&quot;/&gt;
&lt;websockets/&gt;
&lt;session-cookie http-only=&quot;true&quot; secure=&quot;true&quot;/&gt;
&lt;!-- Optimized session management for HTTP/2 multiplexing --&gt;
&lt;persistent-sessions/&gt;
&lt;/servlet-container&gt;
&lt;/subsystem&gt;
</pre>
<section><a id="Configuration_Benefits"></a>
<h3>Configuration Benefits</h3>
<div style="background-color: #fff4e6; border: 1px solid #ff9800; padding: 10px; margin: 10px 0;">
<strong>&#x1f4ca; Production Performance Results</strong> <em>(illustrative estimates &#x2014; actual results
depend on payload size, network conditions, and JVM configuration):</em>
<ul>
<li><strong>~3% Average Performance Improvement</strong> - 14.8s &#x2192; 14.4s response times</li>
<li><strong>~4% Better Minimum Response Times</strong> - 13.0s &#x2192; 12.5s best-case performance</li>
<li><strong>64KB Buffer Alignment</strong> - Consistent across WildFly and Enhanced Moshi H2</li>
<li><strong>Enhanced Monitoring</strong> - Detailed access logging for performance tracking</li>
</ul>
</div>
</section><section><a id="Key_Configuration_Highlights"></a>
<h3>Key Configuration Highlights</h3>
<table class="bodyTableBorder">
<tr class="a">
<th>Parameter</th>
<th>Production Value</th>
<th>Optimization Purpose</th></tr>
<tr class="b">
<td>buffer-size</td>
<td>65536 (64KB)</td>
<td>Aligned with Enhanced Moshi H2 processing</td></tr>
<tr class="a">
<td>http2-initial-window-size</td>
<td>2097152 (2MB)</td>
<td>Avoids flow-control round trips on large responses</td></tr>
<tr class="b">
<td>http2-max-frame-size</td>
<td>65536 (64KB)</td>
<td>Consistent buffer alignment across layers</td></tr>
<tr class="a">
<td>http2-max-concurrent-streams</td>
<td>75</td>
<td>Memory-constrained optimization</td></tr>
<tr class="b">
<td>receive-buffer</td>
<td>4194304 (4MB)</td>
<td>Large payload handling</td></tr>
<tr class="a">
<td>send-buffer</td>
<td>2097152 (2MB)</td>
<td>Balanced throughput optimization</td></tr>
</table>
</section><section><a id="Enhanced_Moshi_H2_.2B_WildFly_HTTP.2F2_Synergy_Analysis"></a>
<h3>Enhanced Moshi H2 + WildFly HTTP/2 Synergy Analysis</h3>
<p><strong>These configurations work together optimally</strong> - WildFly handles HTTP/2 protocol, Enhanced Moshi H2 optimizes JSON processing:</p>
<table class="bodyTableBorder">
<tr class="a">
<th>Layer</th>
<th>WildFly HTTP/2 Parameters</th>
<th>Enhanced Moshi H2 Parameters</th>
<th>Synergy</th></tr>
<tr class="b">
<td><strong>Connection Management</strong></td>
<td><code>http2-max-concurrent-streams=&quot;128&quot;</code></td>
<td><code>maxConcurrentStreams=&quot;128&quot;</code> (axis2.xml)</td>
<td>&#x2705; WildFly manages 128 concurrent HTTP/2 streams, transport sender matches</td>
</tr>
<tr class="a">
<td><strong>Flow Control Window</strong></td>
<td><code>http2-initial-window-size=&quot;2097152&quot;</code></td>
<td><code>initialWindowSize=&quot;2097152&quot;</code> (in axis2.xml)</td>
<td>&#x2705; 2MB window prevents round-trip latency on large responses</td>
</tr>
<tr class="b">
<td><strong>Streaming Flush Buffer</strong></td>
<td><code>buffer-size=&quot;65536&quot;</code></td>
<td><code>streamingBufferSize=&quot;65536&quot;</code> (in axis2.xml)</td>
<td>&#x2705; 64KB server-side flush interval &#x2014; good TTFB, independent of flow-control window</td>
</tr>
<tr class="a">
<td><strong>Large Payload Handling</strong></td>
<td><code>http2-max-frame-size=&quot;16384&quot;</code></td>
<td>(handled by message formatter)</td>
<td>&#x2705; WildFly chunks large payloads via HTTP/2 DATA frames; streaming formatter handles large JSON</td>
</tr>
<tr class="b">
<td><strong>Memory Optimization</strong></td>
<td><code>http2-header-table-size=&quot;4096&quot;</code></td>
<td>(JVM default is sufficient)</td>
<td>&#x2705; Conservative header caching; JVM default direct memory limit is adequate</td>
</tr>
<tr class="a">
<td><strong>Push Disabled</strong></td>
<td><code>http2-enable-push=&quot;false&quot;</code></td>
<td>N/A</td>
<td>&#x2705; Server push disabled for web services - reduces complexity, focuses on request/response optimization</td>
</tr>
</table>
</section><section><a id="Recommended_Coordinated_Configuration"></a>
<h3>Recommended Coordinated Configuration</h3>
<p><strong>For optimal performance with Enhanced Moshi H2, use these coordinated WildFly 32 parameters</strong>:</p>
<pre>
&lt;!-- WildFly 32 HTTP/2 Settings Optimized for Enhanced Moshi H2 --&gt;
&lt;!-- CORRECTED: Uses your existing ssl-context and matches buffer sizes --&gt;
&lt;!-- Buffer Pool Configuration (Aligned with HTTP/2 frame sizes) --&gt;
&lt;byte-buffer-pool name=&quot;default&quot; buffer-size=&quot;32768&quot; max-pool-size=&quot;1024&quot; direct=&quot;true&quot;/&gt;
&lt;buffer-cache name=&quot;default&quot; buffer-size=&quot;32768&quot;/&gt;
&lt;!-- HTTPS Listener with HTTP/2 Parameters --&gt;
&lt;https-listener name=&quot;https&quot; socket-binding=&quot;https&quot;
ssl-context=&quot;applicationSSC&quot; &lt;!-- CORRECTED: Matches your existing SSL context --&gt;
enable-http2=&quot;true&quot;
http2-enable-push=&quot;false&quot;
http2-header-table-size=&quot;4096&quot; &lt;!-- Conservative headers --&gt;
http2-initial-window-size=&quot;2097152&quot; &lt;!-- 2MB: avoids flow-control round trips --&gt;
http2-max-concurrent-streams=&quot;100&quot; &lt;!-- Coordinated with transport-h2 --&gt;
http2-max-frame-size=&quot;32768&quot; &lt;!-- ALIGNED: Matches buffer pool --&gt;
http2-max-header-list-size=&quot;16384&quot; &lt;!-- Sufficient for JSON APIs --&gt;
max-connections=&quot;200&quot; &lt;!-- Matches your existing setup --&gt;
receive-buffer=&quot;2097152&quot; &lt;!-- Keep existing 2MB --&gt;
send-buffer=&quot;1048576&quot; &lt;!-- Keep existing 1MB --&gt;
no-request-timeout=&quot;300000&quot; &lt;!-- 5min timeout for large payloads --&gt;
max-post-size=&quot;104857600&quot;/&gt; &lt;!-- 100MB max request size --&gt;
</pre>
</section><section><a id="Complete_Three-Layer_Architecture"></a>
<h3>Complete Three-Layer Architecture</h3>
<p><strong>WildFly HTTP/2 + transport-h2 + Enhanced Moshi H2 provides comprehensive optimization</strong>:</p>
<pre>
Complete HTTP/2 + JSON Optimization Stack:
&#x250c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2510;
&#x2502; 1. WildFly HTTP/2 (Server-Level) &#x2502;
&#x2502; - HTTP/2 protocol negotiation and ALPN &#x2502;
&#x2502; - Connection multiplexing and flow control &#x2502;
&#x2502; - TLS termination and header compression &#x2502;
&#x2514;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2518;
&#x2502;
&#x250c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2510;
&#x2502; 2. transport-h2 Module (Axis2 HTTP/2 Transport) &#x2502;
&#x2502; - HTTP/2 client transport for outbound requests &#x2502;
&#x2502; - H2TransportSender with HTTP/2.0 protocol &#x2502;
&#x2502; - Stream management and async connection pooling &#x2502;
&#x2514;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2518;
&#x2502;
&#x250c;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2510;
&#x2502; 3. Enhanced Moshi H2 (JSON Processing) &#x2502;
&#x2502; - JSON &#x2192; OMElement conversion optimization &#x2502;
&#x2502; - Async processing for large payloads (1MB+) &#x2502;
&#x2502; - Field-specific parsing and memory management &#x2502;
&#x2514;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2518;
</pre>
<ul>
<li><strong>Inbound HTTP/2</strong>: WildFly handles HTTP/2 &#x2192; HTTP/1.1 bridge to Axis2 servlet</li>
<li><strong>Outbound HTTP/2</strong>: transport-h2 provides native HTTP/2 client transport</li>
<li><strong>JSON Optimization</strong>: Enhanced Moshi H2 optimizes JSON-to-OMElement conversion</li>
<li><strong>No Integration Conflicts</strong>: Each layer operates independently</li>
<li><strong>Cumulative Benefits</strong>: HTTP/2 multiplexing + async JSON processing + memory optimization</li>
</ul>
</section><section><a id="Critical_Configuration_Coordination"></a>
<h3>Critical Configuration Coordination</h3>
<p><strong>&#x26a0;&#xfe0f; IMPORTANT</strong>: For optimal performance, these configurations must be coordinated:</p>
<table class="bodyTableBorder">
<tr class="a">
<th>Configuration Aspect</th>
<th>WildFly 32 HTTP/2</th>
<th>transport-h2</th>
<th>Enhanced Moshi H2</th>
<th>Coordination Status</th></tr>
<tr class="b">
<td><strong>Buffer Sizes</strong></td>
<td><code>buffer-size=&quot;32768&quot;</code><br /><code>http2-max-frame-size=&quot;32768&quot;</code></td>
<td><code>streamingBufferSize=&quot;32768&quot;</code></td>
<td><code>streamingBufferSize=&quot;32768&quot;</code></td>
<td>&#x2705; <strong>ALIGNED</strong>: All using 32KB</td>
</tr>
<tr class="a">
<td><strong>Window Sizes</strong></td>
<td><code>http2-initial-window-size=&quot;2097152&quot;</code></td>
<td><code>initialWindowSize=&quot;2097152&quot;</code></td>
<td>(automatic)</td>
<td>&#x2705; <strong>TUNED</strong>: 2MB flow-control windows across both layers</td>
</tr>
<tr class="b">
<td><strong>Stream Limits</strong></td>
<td><code>http2-max-concurrent-streams=&quot;100&quot;</code></td>
<td><code>maxConcurrentStreams=&quot;100&quot;</code></td>
<td>Async processing based on payload size</td>
<td>&#x2705; <strong>MATCHED</strong>: 100 streams across layers</td>
</tr>
<tr class="a">
<td><strong>Large Payloads</strong></td>
<td><code>max-post-size=&quot;104857600&quot;</code> (100MB)<br /><code>no-request-timeout=&quot;300000&quot;</code> (5min)</td>
<td><code>responseTimeout=&quot;300000&quot;</code> (5min)</td>
<td>(handled by formatter)</td>
<td>&#x2705; <strong>COORDINATED</strong>: Timeout alignment</td>
</tr>
<tr class="b">
<td><strong>SSL Context</strong></td>
<td><code>ssl-context=&quot;applicationSSC&quot;</code></td>
<td>Uses WildFly SSL context</td>
<td>N/A</td>
<td>&#x2705; <strong>CORRECTED</strong>: Matches your actual SSL context name</td>
</tr>
</table>
</section><section><a id="Minimal_vs_Optimal_Configuration_Matrix"></a>
<h3>Minimal vs Optimal Configuration Matrix</h3>
<table class="bodyTableBorder">
<tr class="a">
<th>Deployment Scenario</th>
<th>WildFly HTTP/2</th>
<th>transport-h2</th>
<th>Enhanced Moshi H2</th>
<th>Performance Expectation</th></tr>
<tr class="b">
<td><strong>Minimal (HTTP/1.1 only)</strong></td>
<td>&#x274c; Disabled</td>
<td>&#x274c; Not deployed</td>
<td>&#x2705; Basic Moshi processing</td>
<td>Baseline performance</td>
</tr>
<tr class="a">
<td><strong>Inbound HTTP/2 Only</strong></td>
<td>&#x2705; Enabled</td>
<td>&#x274c; HTTP/1.1 transport</td>
<td>&#x2705; Enhanced Moshi H2</td>
<td>+25% inbound improvement</td>
</tr>
<tr class="b">
<td><strong>Outbound HTTP/2 Only</strong></td>
<td>&#x274c; HTTP/1.1 server</td>
<td>&#x2705; H2TransportSender</td>
<td>&#x2705; Enhanced Moshi H2</td>
<td>+35% outbound improvement</td>
</tr>
<tr class="a">
<td><strong>Full HTTP/2 + Moshi H2</strong></td>
<td>&#x2705; Optimized config</td>
<td>&#x2705; Coordinated params</td>
<td>&#x2705; All optimizations</td>
<td>+50-70% overall improvement</td>
</tr>
</table>
<p><strong>&#x2705; CONCLUSION</strong>: The three-layer approach provides **optimal balance** - WildFly handles HTTP/2 protocol, transport-h2 enables HTTP/2 clients, Enhanced Moshi H2 optimizes JSON processing. All three layers are **independent but coordinated** for maximum performance.</p>
</section><section><a id="Complete_Coordinated_Configuration_Example"></a>
<h3>Complete Coordinated Configuration Example</h3>
<section><a id="a1._WildFly_32_standalone.xml_.28Server_HTTP.2F2.29"></a>
<h4>1. WildFly 32 standalone.xml (Server HTTP/2)</h4>
<pre>
&lt;subsystem xmlns=&quot;urn:jboss:domain:undertow:14.0&quot;
default-virtual-host=&quot;default-host&quot;
default-servlet-container=&quot;default&quot;
default-server=&quot;default-server&quot;&gt;
&lt;!-- CORRECTED: Aligned buffer pools for HTTP/2 optimization --&gt;
&lt;byte-buffer-pool name=&quot;default&quot; buffer-size=&quot;32768&quot; max-pool-size=&quot;1024&quot; direct=&quot;true&quot;/&gt;
&lt;buffer-cache name=&quot;default&quot; buffer-size=&quot;32768&quot;/&gt;
&lt;server name=&quot;default-server&quot;&gt;
&lt;!-- HTTP Connector with HTTP/2 support --&gt;
&lt;http-listener name=&quot;default&quot; socket-binding=&quot;http&quot;
max-post-size=&quot;104857600&quot;
redirect-socket=&quot;https&quot;
enable-http2=&quot;true&quot;
http2-enable-push=&quot;false&quot;
http2-header-table-size=&quot;4096&quot;
http2-initial-window-size=&quot;2097152&quot; &lt;!-- 2MB: avoids flow-control round trips --&gt;
http2-max-concurrent-streams=&quot;100&quot; &lt;!-- Matches transport-h2 limit --&gt;
http2-max-frame-size=&quot;32768&quot; &lt;!-- ALIGNED: Matches buffer pool --&gt;
http2-max-header-list-size=&quot;16384&quot;
max-connections=&quot;200&quot;
receive-buffer=&quot;2097152&quot;
send-buffer=&quot;1048576&quot;
no-request-timeout=&quot;300000&quot;/&gt; &lt;!-- 5min for large payloads --&gt;
&lt;!-- HTTPS Connector (Production) --&gt;
&lt;https-listener name=&quot;https&quot; socket-binding=&quot;https&quot;
max-post-size=&quot;104857600&quot;
ssl-context=&quot;applicationSSC&quot; &lt;!-- CORRECTED: Your actual SSL context --&gt;
enable-http2=&quot;true&quot;
http2-enable-push=&quot;false&quot;
http2-header-table-size=&quot;4096&quot;
http2-initial-window-size=&quot;2097152&quot; &lt;!-- 2MB: avoids flow-control round trips --&gt;
http2-max-concurrent-streams=&quot;100&quot; &lt;!-- Matches transport-h2 limit --&gt;
http2-max-frame-size=&quot;32768&quot; &lt;!-- ALIGNED: Matches buffer pool --&gt;
http2-max-header-list-size=&quot;16384&quot;
max-connections=&quot;200&quot;
receive-buffer=&quot;2097152&quot;
send-buffer=&quot;1048576&quot;
no-request-timeout=&quot;300000&quot;/&gt; &lt;!-- 5min for large payloads --&gt;
&lt;host name=&quot;default-host&quot; alias=&quot;localhost&quot;&gt;
&lt;access-log pattern=&quot;%h %t &quot;%r&quot; %s %b %T Protocol:%H&quot;/&gt;
&lt;filter-ref name=&quot;gzip-compression&quot;/&gt;
&lt;/host&gt;
&lt;/server&gt;
&lt;filters&gt;
&lt;gzip name=&quot;gzip-compression&quot;/&gt;
&lt;/filters&gt;
&lt;servlet-container name=&quot;default&quot;&gt;
&lt;jsp-config development=&quot;false&quot;/&gt;
&lt;websockets/&gt;
&lt;session-cookie http-only=&quot;true&quot; secure=&quot;true&quot;/&gt;
&lt;/servlet-container&gt;
&lt;/subsystem&gt;
</pre>
</section><section><a id="a2._Axis2.xml_.28transport-h2_.2B_Enhanced_Moshi_H2.29"></a>
<h4>2. Axis2.xml (transport-h2 + Enhanced Moshi H2)</h4>
<pre>
&lt;axisconfig name=&quot;AxisJava2.0-HTTP2-EnhancedMoshiH2-Complete&quot;&gt;
&lt;!-- JSON processing is configured by selecting the message builder
and formatter classes below &#x2014; no additional threshold parameters
are needed at the axis2.xml level. --&gt;
&lt;!-- Enhanced JSON Message Builder --&gt;
&lt;messageBuilder contentType=&quot;application/json&quot;
class=&quot;org.apache.axis2.json.moshih2.EnhancedMoshiJsonBuilder&quot;/&gt;
&lt;!-- Enhanced JSON Message Formatter --&gt;
&lt;messageFormatter contentType=&quot;application/json&quot;
class=&quot;org.apache.axis2.json.moshih2.EnhancedMoshiJsonFormatter&quot;/&gt;
&lt;!-- HTTP/1.1 Transport (Fallback) --&gt;
&lt;transportSender name=&quot;http&quot;
class=&quot;org.apache.axis2.transport.http.impl.httpclient5.HTTPClient5TransportSender&quot;&gt;
&lt;parameter name=&quot;PROTOCOL&quot;&gt;HTTP/1.1&lt;/parameter&gt;
&lt;/transportSender&gt;
&lt;!-- HTTP/2 Transport (Coordinated with WildFly + Moshi) --&gt;
&lt;transportSender name=&quot;h2&quot;
class=&quot;org.apache.axis2.transport.h2.impl.httpclient5.H2TransportSender&quot;&gt;
&lt;parameter name=&quot;PROTOCOL&quot;&gt;HTTP/2.0&lt;/parameter&gt;
&lt;!-- Coordination with WildFly HTTP/2 --&gt;
&lt;parameter name=&quot;maxConcurrentStreams&quot;&gt;100&lt;/parameter&gt; &lt;!-- Matches WildFly --&gt;
&lt;parameter name=&quot;initialWindowSize&quot;&gt;2097152&lt;/parameter&gt; &lt;!-- 2MB: avoids flow-control round trips --&gt;
&lt;parameter name=&quot;maxConnectionsTotal&quot;&gt;50&lt;/parameter&gt;
&lt;parameter name=&quot;maxConnectionsPerRoute&quot;&gt;10&lt;/parameter&gt;
&lt;parameter name=&quot;connectionTimeout&quot;&gt;30000&lt;/parameter&gt;
&lt;parameter name=&quot;responseTimeout&quot;&gt;300000&lt;/parameter&gt; &lt;!-- 5min matches WildFly --&gt;
&lt;!-- JSON streaming is handled by the message formatter (e.g.
MoshiStreamingMessageFormatter) &#x2014; no additional transport sender
parameters are needed for Moshi integration. --&gt;
&lt;/transportSender&gt;
&lt;/axisconfig&gt;
</pre>
</section><section><a id="a3._Service_Configuration_.28Protocol_Selection.29"></a>
<h4>3. Service Configuration (Protocol Selection)</h4>
<pre>
// Use HTTP/2 transport for outbound calls
ServiceClient client = new ServiceClient();
client.getOptions().setProperty(Constants.Configuration.TRANSPORT_NAME, &quot;h2&quot;);
client.getOptions().setTo(new EndpointReference(&quot;https://api.example.com/service&quot;));
// Streaming and async processing are handled automatically by the
// message formatter selected in axis2.xml. No client-side flags needed.
</pre>
</section><section><a id="a4._Performance_Validation"></a>
<h4>4. Performance Validation</h4>
<pre>
// Validate configuration alignment
curl -k --http2 --location 'https://localhost:8443/services/YourService' \
--header 'Content-Type: application/json' \
--data '{&quot;largePayload&quot;: &quot;...&quot;}' \
--trace-ascii trace.log
# Check for:
# - HTTP/2 protocol negotiation
# - Enhanced Moshi H2 async processing logs
# - Buffer alignment efficiency
# - No class loader conflicts
</pre>
</section></section></section><section><a id="Troubleshooting"></a>
<h2>Troubleshooting</h2>
<p>Common issues and resolution:</p>
<table class="bodyTableBorder">
<tr class="a">
<th>Symptom</th>
<th>Cause</th>
<th>Fix</th></tr>
<tr class="b">
<td>HTTP/1.1 used despite <code>enable-http2=&quot;true&quot;</code></td>
<td>Missing ALPN or TLS &lt; 1.2</td>
<td>Ensure OpenJDK 11+ and <code>ssl-context</code> configured with TLS 1.2+</td>
</tr>
<tr class="a">
<td>502 Bad Gateway on large responses</td>
<td>Reverse proxy timeout before data flows</td>
<td>Use streaming JSON formatter (<code>FlushingOutputStream</code>) &#x2014; flushes every 64 KB</td>
</tr>
<tr class="b">
<td>ClassLoader conflicts with log4j</td>
<td>WildFly's jboss-logmanager conflicts with WAR's log4j-core</td>
<td>Add <code>jboss-deployment-structure.xml</code> excluding <code>org.apache.logging.log4j.api</code></td>
</tr>
<tr class="a">
<td>Buffer alignment warnings</td>
<td>WildFly buffer size (2KB default) mismatched with Axis2 flush interval (64KB)</td>
<td>Set <code>buffer-size=&quot;32768&quot;</code> in WildFly's Undertow config to align with Axis2</td>
</tr>
</table>
<section><a id="Deployment_sizing"></a>
<h3>Deployment sizing</h3>
<table class="bodyTableBorder">
<tr class="a">
<th>Environment</th>
<th>Memory</th>
<th>Configuration</th></tr>
<tr class="b">
<td>Memory-constrained</td>
<td>&#x2264; 2GB</td>
<td>32KB buffers, 50 streams</td></tr>
<tr class="a">
<td>Balanced production</td>
<td>2-4GB</td>
<td>64KB buffers, 100 streams</td></tr>
<tr class="b">
<td>High-performance</td>
<td>4GB+</td>
<td>64KB+ buffers, 200+ streams</td></tr>
</table>
</section></section>
</main>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<p>© 2004–2026
<a href="https://www.apache.org/">The Apache Software Foundation</a>
</p>
</div>
</div>
</footer>
</body>
</html>