| <!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'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> |
| <!-- Minimal HTTP/2 Transport - Intelligent Defaults Handle Optimization --> |
| <transportSender name="http" class="org.apache.axis2.transport.h2.impl.httpclient5.H2TransportSender"> |
| <parameter name="PROTOCOL">HTTP/2.0</parameter> |
| </transportSender> |
| </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 — 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 |
| — Tuning for Different Workloads</a>. |
| </div> |
| |
| |
| <pre> |
| <subsystem xmlns="urn:jboss:domain:undertow:14.0" |
| default-virtual-host="default-host" |
| default-servlet-container="default" |
| default-server="default-server" |
| statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" |
| default-security-domain="other"> |
| |
| <!-- MINIMAL WILDFLY HTTP/2 - Optimized Buffer Pool Configuration --> |
| <!-- Aligned with Enhanced Moshi H2 processing (64KB standard across all layers) --> |
| <!-- Reduces buffer fragmentation and improves memory efficiency --> |
| <byte-buffer-pool name="default" buffer-size="65536" max-pool-size="512" direct="true"/> |
| |
| <!-- Single-Layer Buffer Cache - Optimized for JSON Processing --> |
| <!-- Aligned 64KB cache for consistent buffer management --> |
| <buffer-cache name="default" buffer-size="65536" buffers-per-region="64"/> |
| |
| <server name="default-server"> |
| <!-- MINIMAL WILDFLY HTTP/2 - Optimized for Single-Layer Processing --> |
| <!-- Reduced protocol overhead, optimized for Enhanced Moshi H2 JSON processing --> |
| <http-listener name="default" socket-binding="http" |
| max-post-size="104857600" |
| redirect-socket="https" |
| enable-http2="true" |
| http2-enable-push="false" |
| http2-header-table-size="8192" |
| http2-initial-window-size="2097152" |
| http2-max-concurrent-streams="75" |
| http2-max-frame-size="65536" |
| http2-max-header-list-size="32768" |
| max-connections="150" |
| receive-buffer="4194304" |
| send-buffer="2097152" |
| no-request-timeout="300000" |
| request-parse-timeout="60000" |
| tcp-backlog="1024"/> |
| |
| <!-- MINIMAL WILDFLY HTTP/2 HTTPS - Aligned with HTTP configuration --> |
| <!-- SSL-optimized single-layer HTTP/2 processing --> |
| <https-listener name="https" socket-binding="https" |
| max-post-size="104857600" |
| ssl-context="applicationSSC" |
| enable-http2="true" |
| http2-enable-push="false" |
| http2-header-table-size="8192" |
| http2-initial-window-size="2097152" |
| http2-max-concurrent-streams="75" |
| http2-max-frame-size="65536" |
| http2-max-header-list-size="32768" |
| max-connections="150" |
| receive-buffer="4194304" |
| send-buffer="2097152" |
| no-request-timeout="300000" |
| request-parse-timeout="60000" |
| tcp-backlog="1024"/> |
| |
| <host name="default-host" alias="localhost"> |
| <!-- Enhanced Access Log for HTTP/2 Performance Monitoring --> |
| <access-log pattern="%h %l %u %t "%r" %s %b "%{i,Referer}" "%{i,User-Agent}" Cookie: "%{i,COOKIE}" Set-Cookie: "%{o,SET-COOKIE}" SessionID: %S Thread: "%I" TimeTaken: %T Protocol: %H Bytes: %B"/> |
| |
| <!-- HTTP/2 Performance Optimization Filters --> |
| <filter-ref name="gzip-compression"/> |
| <filter-ref name="cache-control-headers"/> |
| </host> |
| </server> |
| |
| <!-- HTTP/2 Optimization Filters --> |
| <filters> |
| <!-- JSON compression for JSON-RPC / REST operations (30-50% reduction) --> |
| <gzip name="gzip-compression"/> |
| |
| <!-- Cache Control Headers for Static Resources --> |
| <response-header name="cache-control-headers" |
| header-name="Cache-Control" |
| header-value="public, max-age=2592000"/> |
| </filters> |
| |
| <!-- MINIMAL WILDFLY HTTP/2 - Optimized Servlet Container --> |
| <!-- Enhanced for single-layer HTTP/2 and JSON processing --> |
| <servlet-container name="default" default-buffer-cache="default" |
| stack-trace-on-error="local-only" |
| default-encoding="UTF-8"> |
| <jsp-config development="false" mapped-file="false" check-interval="0" |
| x-powered-by="false" display-source-fragment="false"/> |
| <websockets/> |
| <session-cookie http-only="true" secure="true"/> |
| <!-- Optimized session management for HTTP/2 multiplexing --> |
| <persistent-sessions/> |
| </servlet-container> |
| </subsystem> |
| </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>📊 Production Performance Results</strong> <em>(illustrative estimates — actual results |
| depend on payload size, network conditions, and JVM configuration):</em> |
| |
| <ul> |
| |
| <li><strong>~3% Average Performance Improvement</strong> - 14.8s → 14.4s response times</li> |
| |
| <li><strong>~4% Better Minimum Response Times</strong> - 13.0s → 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="128"</code></td> |
| |
| <td><code>maxConcurrentStreams="128"</code> (axis2.xml)</td> |
| |
| <td>✅ 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="2097152"</code></td> |
| |
| <td><code>initialWindowSize="2097152"</code> (in axis2.xml)</td> |
| |
| <td>✅ 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="65536"</code></td> |
| |
| <td><code>streamingBufferSize="65536"</code> (in axis2.xml)</td> |
| |
| <td>✅ 64KB server-side flush interval — 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="16384"</code></td> |
| |
| <td>(handled by message formatter)</td> |
| |
| <td>✅ 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="4096"</code></td> |
| |
| <td>(JVM default is sufficient)</td> |
| |
| <td>✅ 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="false"</code></td> |
| |
| <td>N/A</td> |
| |
| <td>✅ 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> |
| <!-- WildFly 32 HTTP/2 Settings Optimized for Enhanced Moshi H2 --> |
| <!-- CORRECTED: Uses your existing ssl-context and matches buffer sizes --> |
| |
| <!-- Buffer Pool Configuration (Aligned with HTTP/2 frame sizes) --> |
| <byte-buffer-pool name="default" buffer-size="32768" max-pool-size="1024" direct="true"/> |
| <buffer-cache name="default" buffer-size="32768"/> |
| |
| <!-- HTTPS Listener with HTTP/2 Parameters --> |
| <https-listener name="https" socket-binding="https" |
| ssl-context="applicationSSC" <!-- CORRECTED: Matches your existing SSL context --> |
| enable-http2="true" |
| http2-enable-push="false" |
| http2-header-table-size="4096" <!-- Conservative headers --> |
| http2-initial-window-size="2097152" <!-- 2MB: avoids flow-control round trips --> |
| http2-max-concurrent-streams="100" <!-- Coordinated with transport-h2 --> |
| http2-max-frame-size="32768" <!-- ALIGNED: Matches buffer pool --> |
| http2-max-header-list-size="16384" <!-- Sufficient for JSON APIs --> |
| max-connections="200" <!-- Matches your existing setup --> |
| receive-buffer="2097152" <!-- Keep existing 2MB --> |
| send-buffer="1048576" <!-- Keep existing 1MB --> |
| no-request-timeout="300000" <!-- 5min timeout for large payloads --> |
| max-post-size="104857600"/> <!-- 100MB max request size --> |
| </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: |
| ┌─────────────────────────────────────────────────────────────┐ |
| │ 1. WildFly HTTP/2 (Server-Level) │ |
| │ - HTTP/2 protocol negotiation and ALPN │ |
| │ - Connection multiplexing and flow control │ |
| │ - TLS termination and header compression │ |
| └─────────────────────────────────────────────────────────────┘ |
| │ |
| ┌─────────────────────────────────────────────────────────────┐ |
| │ 2. transport-h2 Module (Axis2 HTTP/2 Transport) │ |
| │ - HTTP/2 client transport for outbound requests │ |
| │ - H2TransportSender with HTTP/2.0 protocol │ |
| │ - Stream management and async connection pooling │ |
| └─────────────────────────────────────────────────────────────┘ |
| │ |
| ┌─────────────────────────────────────────────────────────────┐ |
| │ 3. Enhanced Moshi H2 (JSON Processing) │ |
| │ - JSON → OMElement conversion optimization │ |
| │ - Async processing for large payloads (1MB+) │ |
| │ - Field-specific parsing and memory management │ |
| └─────────────────────────────────────────────────────────────┘ |
| </pre> |
| |
| |
| <ul> |
| |
| <li><strong>Inbound HTTP/2</strong>: WildFly handles HTTP/2 → 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>⚠️ 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="32768"</code><br /><code>http2-max-frame-size="32768"</code></td> |
| |
| <td><code>streamingBufferSize="32768"</code></td> |
| |
| <td><code>streamingBufferSize="32768"</code></td> |
| |
| <td>✅ <strong>ALIGNED</strong>: All using 32KB</td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td><strong>Window Sizes</strong></td> |
| |
| <td><code>http2-initial-window-size="2097152"</code></td> |
| |
| <td><code>initialWindowSize="2097152"</code></td> |
| |
| <td>(automatic)</td> |
| |
| <td>✅ <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="100"</code></td> |
| |
| <td><code>maxConcurrentStreams="100"</code></td> |
| |
| <td>Async processing based on payload size</td> |
| |
| <td>✅ <strong>MATCHED</strong>: 100 streams across layers</td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td><strong>Large Payloads</strong></td> |
| |
| <td><code>max-post-size="104857600"</code> (100MB)<br /><code>no-request-timeout="300000"</code> (5min)</td> |
| |
| <td><code>responseTimeout="300000"</code> (5min)</td> |
| |
| <td>(handled by formatter)</td> |
| |
| <td>✅ <strong>COORDINATED</strong>: Timeout alignment</td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td><strong>SSL Context</strong></td> |
| |
| <td><code>ssl-context="applicationSSC"</code></td> |
| |
| <td>Uses WildFly SSL context</td> |
| |
| <td>N/A</td> |
| |
| <td>✅ <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>❌ Disabled</td> |
| |
| <td>❌ Not deployed</td> |
| |
| <td>✅ Basic Moshi processing</td> |
| |
| <td>Baseline performance</td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td><strong>Inbound HTTP/2 Only</strong></td> |
| |
| <td>✅ Enabled</td> |
| |
| <td>❌ HTTP/1.1 transport</td> |
| |
| <td>✅ Enhanced Moshi H2</td> |
| |
| <td>+25% inbound improvement</td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td><strong>Outbound HTTP/2 Only</strong></td> |
| |
| <td>❌ HTTP/1.1 server</td> |
| |
| <td>✅ H2TransportSender</td> |
| |
| <td>✅ Enhanced Moshi H2</td> |
| |
| <td>+35% outbound improvement</td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td><strong>Full HTTP/2 + Moshi H2</strong></td> |
| |
| <td>✅ Optimized config</td> |
| |
| <td>✅ Coordinated params</td> |
| |
| <td>✅ All optimizations</td> |
| |
| <td>+50-70% overall improvement</td> |
| </tr> |
| </table> |
| |
| |
| <p><strong>✅ 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> |
| <subsystem xmlns="urn:jboss:domain:undertow:14.0" |
| default-virtual-host="default-host" |
| default-servlet-container="default" |
| default-server="default-server"> |
| |
| <!-- CORRECTED: Aligned buffer pools for HTTP/2 optimization --> |
| <byte-buffer-pool name="default" buffer-size="32768" max-pool-size="1024" direct="true"/> |
| <buffer-cache name="default" buffer-size="32768"/> |
| |
| <server name="default-server"> |
| <!-- HTTP Connector with HTTP/2 support --> |
| <http-listener name="default" socket-binding="http" |
| max-post-size="104857600" |
| redirect-socket="https" |
| enable-http2="true" |
| http2-enable-push="false" |
| http2-header-table-size="4096" |
| http2-initial-window-size="2097152" <!-- 2MB: avoids flow-control round trips --> |
| http2-max-concurrent-streams="100" <!-- Matches transport-h2 limit --> |
| http2-max-frame-size="32768" <!-- ALIGNED: Matches buffer pool --> |
| http2-max-header-list-size="16384" |
| max-connections="200" |
| receive-buffer="2097152" |
| send-buffer="1048576" |
| no-request-timeout="300000"/> <!-- 5min for large payloads --> |
| |
| <!-- HTTPS Connector (Production) --> |
| <https-listener name="https" socket-binding="https" |
| max-post-size="104857600" |
| ssl-context="applicationSSC" <!-- CORRECTED: Your actual SSL context --> |
| enable-http2="true" |
| http2-enable-push="false" |
| http2-header-table-size="4096" |
| http2-initial-window-size="2097152" <!-- 2MB: avoids flow-control round trips --> |
| http2-max-concurrent-streams="100" <!-- Matches transport-h2 limit --> |
| http2-max-frame-size="32768" <!-- ALIGNED: Matches buffer pool --> |
| http2-max-header-list-size="16384" |
| max-connections="200" |
| receive-buffer="2097152" |
| send-buffer="1048576" |
| no-request-timeout="300000"/> <!-- 5min for large payloads --> |
| |
| <host name="default-host" alias="localhost"> |
| <access-log pattern="%h %t "%r" %s %b %T Protocol:%H"/> |
| <filter-ref name="gzip-compression"/> |
| </host> |
| </server> |
| |
| <filters> |
| <gzip name="gzip-compression"/> |
| </filters> |
| |
| <servlet-container name="default"> |
| <jsp-config development="false"/> |
| <websockets/> |
| <session-cookie http-only="true" secure="true"/> |
| </servlet-container> |
| </subsystem> |
| </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> |
| <axisconfig name="AxisJava2.0-HTTP2-EnhancedMoshiH2-Complete"> |
| |
| <!-- JSON processing is configured by selecting the message builder |
| and formatter classes below — no additional threshold parameters |
| are needed at the axis2.xml level. --> |
| |
| <!-- Enhanced JSON Message Builder --> |
| <messageBuilder contentType="application/json" |
| class="org.apache.axis2.json.moshih2.EnhancedMoshiJsonBuilder"/> |
| |
| <!-- Enhanced JSON Message Formatter --> |
| <messageFormatter contentType="application/json" |
| class="org.apache.axis2.json.moshih2.EnhancedMoshiJsonFormatter"/> |
| |
| <!-- HTTP/1.1 Transport (Fallback) --> |
| <transportSender name="http" |
| class="org.apache.axis2.transport.http.impl.httpclient5.HTTPClient5TransportSender"> |
| <parameter name="PROTOCOL">HTTP/1.1</parameter> |
| </transportSender> |
| |
| <!-- HTTP/2 Transport (Coordinated with WildFly + Moshi) --> |
| <transportSender name="h2" |
| class="org.apache.axis2.transport.h2.impl.httpclient5.H2TransportSender"> |
| <parameter name="PROTOCOL">HTTP/2.0</parameter> |
| |
| <!-- Coordination with WildFly HTTP/2 --> |
| <parameter name="maxConcurrentStreams">100</parameter> <!-- Matches WildFly --> |
| <parameter name="initialWindowSize">2097152</parameter> <!-- 2MB: avoids flow-control round trips --> |
| <parameter name="maxConnectionsTotal">50</parameter> |
| <parameter name="maxConnectionsPerRoute">10</parameter> |
| <parameter name="connectionTimeout">30000</parameter> |
| <parameter name="responseTimeout">300000</parameter> <!-- 5min matches WildFly --> |
| |
| <!-- JSON streaming is handled by the message formatter (e.g. |
| MoshiStreamingMessageFormatter) — no additional transport sender |
| parameters are needed for Moshi integration. --> |
| </transportSender> |
| |
| </axisconfig> |
| </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, "h2"); |
| client.getOptions().setTo(new EndpointReference("https://api.example.com/service")); |
| |
| // 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 '{"largePayload": "..."}' \ |
| --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="true"</code></td> |
| |
| <td>Missing ALPN or TLS < 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>) — 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="32768"</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>≤ 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> |