Skip to content

Commit f63de99

Browse files
Port springbootdemo to Apache Tomcat 11 and fix transport-h2 parameter parsing
Add springbootdemo-tomcat11: copy of the WildFly 32 JSON/Spring Boot demo ported to Apache Tomcat 11.0.20, targeting Axis2 2.0.1-SNAPSHOT. Removes WildFly-specific deployment descriptors (jboss-deployment-structure.xml, jboss-web.xml), excludes DataSource/JPA auto-configuration (not needed — demo DAO is in-memory), and documents Tomcat 11 HTTP/2 setup via <UpgradeProtocol> in server.xml. Also fix bugs found during Tomcat testing that affect both demos: - H2TransportSender: all five getXxxParameter helpers called param.toString() on the Parameter object, producing "Parameter : name=value" instead of the value; fixed to call param.getValue().toString() - bigdata_h2_resources/services.xml: wrong message receiver class (org.apache.axis2.json.JSONMessageReceiver, non-existent) and wrong Spring object supplier package (org.apache.axis2.spring vs org.apache.axis2.extensions.spring.receivers); both corrected - BigDataH2Service.java: three lossy long-to-int conversions on getDatasetSize() division result; added explicit (int) casts - BigDataH2Client.java: HTTPConstants.TRANSPORT_NAME/HTTP_CLIENT_VERSION/ HTTP_CLIENT_5_X moved/renamed in 2.0; updated to string literal and HTTPTransportConstants equivalents; import fixed from transport.http to kernel.http - ESAPI.properties: SafeString regex lacked underscore/hyphen; fixed pattern to ^[\\.\\p{Alnum}\\p{Space}_\\-]{0,1024}$ (double-escaped backslashes required for Java Properties parsing) Add json-springboot-tomcat11-userguide.xml: site doc based on the WildFly guide, documenting Tomcat 11 differences, HTTP/2 <UpgradeProtocol> config, and correct cp -r deploy procedure for the exploded WAR directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 842f372 commit f63de99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5669
-31
lines changed

modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml

Lines changed: 422 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one
3+
~ or more contributor license agreements. See the NOTICE file
4+
~ distributed with this work for additional information
5+
~ regarding copyright ownership. The ASF licenses this file
6+
~ to you under the Apache License, Version 2.0 (the
7+
~ "License"); you may not use this file except in compliance
8+
~ with the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing,
13+
~ software distributed under the License is distributed on an
14+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
~ KIND, either express or implied. See the License for the
16+
~ specific language governing permissions and limitations
17+
~ under the License.
18+
-->
19+
20+
<serviceGroup>
21+
<!-- HTTP/2 Big Data Service for Enterprise JSON Processing -->
22+
<service name="BigDataH2Service" scope="application">
23+
<description>
24+
Enterprise Big Data Processing Service with HTTP/2 Transport Optimization
25+
26+
This service demonstrates HTTP/2 transport capabilities for large JSON datasets:
27+
- Support for 50MB+ JSON payloads with streaming optimization
28+
- Connection multiplexing for concurrent request processing
29+
- Memory-efficient processing within 2GB heap constraints
30+
- Performance monitoring and optimization metrics
31+
32+
Transport Features:
33+
- HTTP/2 streaming for large datasets (50MB+)
34+
- Connection multiplexing for medium datasets (10-50MB)
35+
- Standard HTTP/2 processing for small datasets (&lt;10MB)
36+
- Memory pressure handling and adaptive flow control
37+
38+
Security Features:
39+
- OWASP ESAPI input validation
40+
- HTTPS-only endpoint enforcement
41+
- Enterprise security compliance
42+
</description>
43+
44+
<!-- Service Implementation -->
45+
<parameter name="ServiceClass">userguide.springboot.webservices.BigDataH2Service</parameter>
46+
<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter>
47+
<parameter name="SpringBeanName">bigDataH2Service</parameter>
48+
49+
<!-- HTTP/2 Transport Configuration -->
50+
<parameter name="preferredTransport">h2</parameter>
51+
<parameter name="enableHTTP2">true</parameter>
52+
<parameter name="enableStreaming">true</parameter>
53+
<parameter name="enableMemoryOptimization">true</parameter>
54+
55+
<!-- Large Payload Configuration -->
56+
<parameter name="maxPayloadSize">104857600</parameter> <!-- 100MB -->
57+
<parameter name="streamingThreshold">52428800</parameter> <!-- 50MB -->
58+
<parameter name="connectionTimeout">30000</parameter>
59+
<parameter name="responseTimeout">300000</parameter> <!-- 5 minutes -->
60+
61+
<!-- JSON Processing Configuration -->
62+
<parameter name="enableJSONOnly">true</parameter>
63+
<parameter name="disableSOAP">true</parameter>
64+
65+
<!-- Performance Monitoring -->
66+
<parameter name="enablePerformanceMetrics">true</parameter>
67+
<parameter name="logProcessingTime">true</parameter>
68+
69+
<!-- Service Operations -->
70+
<operation name="processBigDataSet">
71+
<description>
72+
Process large JSON datasets using HTTP/2 optimization features.
73+
Automatically selects optimal processing mode based on dataset size:
74+
- Streaming for 50MB+ datasets
75+
- Multiplexing for 10-50MB datasets
76+
- Standard for &lt;10MB datasets
77+
</description>
78+
79+
<!-- HTTP/2 Operation Configuration -->
80+
<parameter name="enableHTTP2Streaming">true</parameter>
81+
<parameter name="memoryOptimization">true</parameter>
82+
<parameter name="concurrentStreams">5</parameter>
83+
84+
<!-- Input/Output Message Configuration -->
85+
<messageReceivers>
86+
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
87+
class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/>
88+
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-only"
89+
class="org.apache.axis2.json.moshi.rpc.JsonInOnlyRPCMessageReceiver"/>
90+
</messageReceivers>
91+
92+
<!-- Operation-level timeout for large datasets -->
93+
<parameter name="operationTimeout">300000</parameter> <!-- 5 minutes -->
94+
</operation>
95+
96+
<!-- Error Handling Configuration -->
97+
<parameter name="enableDetailedFaults">true</parameter>
98+
<parameter name="faultDetailLevel">full</parameter>
99+
100+
<!-- Security Configuration -->
101+
<parameter name="enableSecurity">true</parameter>
102+
<parameter name="requireHTTPS">true</parameter>
103+
<parameter name="validateInput">true</parameter>
104+
105+
</service>
106+
</serviceGroup>

0 commit comments

Comments
 (0)