[ 
https://issues.apache.org/jira/browse/GEODE-10504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jinwoo Hwang updated GEODE-10504:
---------------------------------
    Fix Version/s: 2.0.0

> Tomcat 11 Support for Apache Geode Session Management
> -----------------------------------------------------
>
>                 Key: GEODE-10504
>                 URL: https://issues.apache.org/jira/browse/GEODE-10504
>             Project: Geode
>          Issue Type: Improvement
>            Reporter: Jinwoo Hwang
>            Assignee: Jinwoo Hwang
>            Priority: Major
>             Fix For: 2.0.0
>
>
> h2. Summary
> Add support for Tomcat 11 to enable Geode session management with Jakarta EE 
> 10 compatible servlet containers. This extends Geode's session replication 
> capabilities to modern Tomcat versions.
> {*}Impact{*}: Session management modules | {*}Risk{*}: Medium | 
> {*}Timeline{*}: 4 weeks
> ----
> h2. Background
> h3. Why Required
>  * {*}Jakarta EE 10 Migration{*}: Tomcat 10/11 uses {{jakarta.*}} namespace
>  * {*}Tomcat Version Support Gap{*}: Currently support Tomcat 7/8/9 (all 
> javax-based)
>  * {*}Modern Application Servers{*}: Customers migrating to Jakarta EE need 
> Tomcat 10/11
>  * {*}Spring Boot 3 Support{*}: Spring Boot 3 requires Tomcat 10.1+ or 11.x
> h3. Current State
>  * {*}Supported{*}: Tomcat 7, 8, 9 (all use {{{}javax.servlet.*{}}})
>  * {*}Target{*}: Add Tomcat 10.1.x and 11.x (use {{{}jakarta.servlet.*{}}})
>  * {*}Affected Modules{*}:
>  ** {{geode-modules-tomcat7}}
>  ** {{geode-modules-tomcat8}}
>  ** {{geode-modules-tomcat9}}
>  ** {*}NEW{*}: {{geode-modules-tomcat10}} (to be created)
>  ** {*}NEW{*}: {{geode-modules-tomcat11}} (to be created)
> ----
> h2. Scope
> h3. *In Scope*
>  * Create {{geode-modules-tomcat10}} module for Tomcat 10.1.x
>  * Create {{geode-modules-tomcat11}} module for Tomcat 11.x
>  * Migrate servlet API from {{javax.*}} to {{jakarta.*}}
>  * Session replication functionality
>  * Session attribute serialization
>  * Tomcat valve integration
>  * Session manager implementation
>  * Delta session support
>  * Build and packaging for new modules
> h3. *Key Changes*
> ||Component||Tomcat 7/8/9||Tomcat 10/11||Migration||
> |*Servlet API*|{{javax.servlet.*}}|{{jakarta.servlet.*}}|🔴 Namespace change|
> |*Tomcat Version*|7.x, 8.x, 9.x|10.1.x, 11.x|🟡 API differences|
> |*Valve API*|{{org.apache.catalina.valves.ValveBase}}|Same package|🟢 
> Compatible|
> |*Session 
> API*|{{javax.servlet.http.HttpSession}}|{{jakarta.servlet.http.HttpSession}}|🔴
>  Namespace change|
> |*Context API*|Tomcat 9 Context|Tomcat 10/11 Context|🟡 Minor changes|
> |*Build Tool*|Gradle|Gradle|🟢 Same|
> ----
> h2. Implementation Plan
> h3. *Phase 1: Module Setup* (Week 1, Days 1-3)
>  * [ ] Create {{geode-modules-tomcat10}} module structure
>  * [ ] Create {{geode-modules-tomcat11}} module structure
>  * [ ] Set up Gradle build files
>  * [ ] Configure Tomcat 10.1.x dependencies
>  * [ ] Configure Tomcat 11.x dependencies
>  * [ ] Copy base code from {{geode-modules-tomcat9}}
> h3. *Phase 2: Jakarta Namespace Migration* (Week 1-2, Days 4-7)
>  * [ ] Update all {{javax.servlet.*}} imports to {{jakarta.servlet.*}}
>  * [ ] Update {{javax.servlet.http.*}} to {{jakarta.servlet.http.*}}
>  * [ ] Update session listener interfaces
>  * [ ] Update filter/valve implementations
>  * [ ] Update servlet context usage
>  * [ ] Verify no remaining {{javax.*}} references
> h3. *Phase 3: Tomcat API Compatibility* (Week 2, Days 8-10)
>  * [ ] Update Tomcat Context API usage
>  * [ ] Migrate Valve implementation for Tomcat 10/11
>  * [ ] Update session manager registration
>  * [ ] Handle Tomcat 10 vs 11 differences (if any)
>  * [ ] Update lifecycle listener integration
> h3. *Phase 4: Session Management Features* (Week 2-3, Days 11-14)
>  * [ ] Delta session replication
>  * [ ] Session attribute serialization
>  * [ ] Session failover handling
>  * [ ] Commit valve functionality
>  * [ ] Session expiration handling
>  * [ ] Session event listeners
> h3. *Phase 5: Configuration & Integration* (Week 3, Days 15-16)
>  * [ ] Create configuration examples for Tomcat 10
>  * [ ] Create configuration examples for Tomcat 11
>  * [ ] Document {{context.xml}} setup
>  * [ ] Document {{server.xml}} configuration
>  * [ ] Create sample applications
> *context.xml Example:*
>  
> {{<Context><Manager 
> className="org.apache.geode.modules.session.catalina.Tomcat10DeltaSessionManager"regionName="gemfire_modules_sessions"enableLocalCache="false"/><Valve
>  
> className="org.apache.geode.modules.session.catalina.SessionReplicationValve"/></Context>}}
> h3. *Phase 6: Testing* (Week 3-4, Days 17-20)
>  * [ ] Unit tests for session management
>  * [ ] Integration tests with Tomcat 10.1
>  * [ ] Integration tests with Tomcat 11
>  * [ ] Session replication tests
>  * [ ] Failover tests
>  * [ ] Performance tests
>  * [ ] Cross-version compatibility tests
> *Test Coverage:*
>  * Session creation and destruction
>  * Session attribute get/set/remove
>  * Session replication across nodes
>  * Session failover scenarios
>  * Delta propagation
>  * Serialization/deserialization
>  * Concurrent session access
> h3. *Phase 7: Documentation* (Week 4, Days 21-22)
>  * [ ] Update user guide for Tomcat 10/11
>  * [ ] Migration guide from Tomcat 9 to 10/11
>  * [ ] Configuration reference
>  * [ ] Troubleshooting guide
>  * [ ] Release notes
> ----
> h2. Technical Details
> h3. Tomcat Version Compatibility Matrix
> ||Tomcat Version||Jakarta EE||Servlet API||Java||Status||
> |7.x|Java EE 6|3.0 (javax)|6+|✅ Supported|
> |8.5.x|Java EE 7|3.1 (javax)|7+|✅ Supported|
> |9.x|Java EE 8|4.0 (javax)|8+|✅ Supported|
> |*10.1.x*|*Jakarta EE 10*|*6.0 (jakarta)*|*11+*|🎯 *Target*|
> |*11.x*|*Jakarta EE 11*|*6.1 (jakarta)*|*17+*|🎯 *Target*|
> h3. Key API Changes
> h4. *1. Servlet API Namespace*
>  
> {{// Tomcat 9 (javax)javax.servlet.Servlet
> javax.servlet.Filter
> javax.servlet.http.HttpServlet
> javax.servlet.http.HttpSession}}
> {{// Tomcat 10/11 (jakarta)jakarta.servlet.Servlet
> jakarta.servlet.Filter
> jakarta.servlet.http.HttpServlet
> jakarta.servlet.http.HttpSession}}
> h4. *2. Session Manager Interface*
>  
> {{// Tomcat 10/11import org.apache.catalina.Manager;}}
> {{import org.apache.catalina.Session;}}
> {{import jakarta.servlet.http.HttpSession;}}
> {{public class Tomcat10DeltaSessionManager extends ManagerBase {}}
> {{ @Overridepublic Session createSession(String sessionId) {     }}
>  {{  DeltaSession session = new DeltaSession(this); }}
>  {{  session.setId(sessionId);        return session;}}
> {{ }}}
> {{}}}
> h4. *3. Session Attribute Handling*
>  
> {{// Both Tomcat 9 and 10/11 (same logic, different imports)}}
> {{public class DeltaSession implements HttpSession {}}
> {{    private final Map<String, Object> attributes = new HashMap<>();}}
>  {{@Overridepublic Object getAttribute(String name) {}}
>  {{        return attributes.get(name);}}
>  {{    }}}
>  {{@Overridepublic void setAttribute(String name, Object value) {}}
>  {{        Object oldValue = attributes.put(name, value);}}
>  {{        // Trigger delta replication}}
>   {{        notifyAttributeChange(name, oldValue, value);}}
>  {{    }}}
> {{}}}
> ----
> h2. Architecture
> h3. Shared vs Version-Specific Code
> *Shared Code (geode-modules-session):*
>  * Session serialization logic
>  * Delta calculation
>  * Geode region interaction
>  * Session event handling
> *Version-Specific Code (tomcat10/11):*
>  * Servlet API implementation
>  * Valve implementation
>  * Manager registration
>  * Context integration
> ----
> h2. Risks & Mitigation
> ||Risk||Impact||Probability||Mitigation||
> |*Tomcat 10/11 API differences*|Incompatibility|Medium|Thorough API review, 
> testing|
> |*Session serialization issues*|Data loss|Low|Extensive serialization tests|
> |*Performance regression*|User impact|Low|Performance benchmarking|
> |*Tomcat version fragmentation*|Maintenance burden|High|Share maximum code 
> via modules|
> |*Jakarta namespace conflicts*|Build failures|Low|Proper dependency 
> management|
> ----
> h2. Dependencies
> {*}Blocked By{*}:
>  * Jakarta EE 10 migration 
>  * Core modules Jakarta migration 
> {*}Blocks{*}:
>  * Spring Boot 3 embedded Tomcat support
>  * Full Jakarta EE ecosystem support
> {*}Related{*}:
>  * Jetty 11 migration (alternative servlet container)
>  * Spring Boot 3 migration
> ----
> h2. Success Criteria
>  * [ ] {{geode-modules-tomcat10}} module created and functional
>  * [ ] {{geode-modules-tomcat11}} module created and functional
>  * [ ] All servlet APIs migrated to {{jakarta.*}} namespace
>  * [ ] Session replication works on Tomcat 10.1.x
>  * [ ] Session replication works on Tomcat 11.x
>  * [ ] All tests passing (unit + integration)
>  * [ ] No performance regression vs Tomcat 9
>  * [ ] Documentation complete
>  * [ ] Sample applications provided
> ----
> h2. Testing Strategy
> h3. *Unit Tests*
>  * Session creation/destruction
>  * Attribute management
>  * Delta calculation
>  * Serialization/deserialization
> h3. *Integration Tests*
>  * {*}Tomcat 10.1{*}: Deploy sample app, test session replication
>  * {*}Tomcat 11{*}: Deploy sample app, test session replication
>  * {*}Multi-node{*}: Session failover across Geode cluster
>  * {*}Load testing{*}: Concurrent session access
> h3. *Compatibility Tests*
>  * Migrate existing Tomcat 9 app to Tomcat 10
>  * Verify session data compatibility
>  * Test rolling upgrades
> ----
> h2. Resources
>  * {*}Development{*}: 4 person-weeks (1 developer × 4 weeks)
>  * {*}QA{*}: 1 week (integration testing)
>  * {*}Documentation{*}: 3 days
>  * {*}Total Effort{*}: ~5 person-weeks
> ----
> h2. References
> h3. *Documentation*
>  * [Tomcat 10 Migration Guide|https://tomcat.apache.org/migration-10.html]
>  * [Tomcat 11 Documentation|https://tomcat.apache.org/tomcat-11.0-doc/]
>  * [Jakarta Servlet 6.0 
> Specification|https://jakarta.ee/specifications/servlet/6.0/]
>  * [Geode Session State Management|https://geode.apache.org/docs/]
> h3. *Related Issues*
>  * Jakarta EE 10 Migration
>  * Spring Boot 3 Migration
>  * Jetty 11 Support
> ----
> h2. Migration Path for Users
> h3. From Tomcat 9 to Tomcat 10/11
> *Step 1: Update Geode Module*
>  
> {{<!-- Before (Tomcat 9) -->}}
> {{<dependency>}}
> {{    <groupId>org.apache.geode</groupId>}}
> {{    <artifactId>geode-modules-tomcat9</artifactId>}}
> {{<version>1.15.x</version>}}
> {{</dependency>}}
> {{<!-- After (Tomcat 10) -->}}
> {{<dependency>}}
> {{    <groupId>org.apache.geode</groupId>}}
> {{    <artifactId>geode-modules-tomcat10</artifactId>}}
> {{<version>2.0.0</version>}}
> {{</dependency>}}
>  
> *Step 2: Update context.xml*
>  
> {{<!-- Change Manager class name --><Manager 
> className="org.apache.geode.modules.session.catalina.Tomcat10DeltaSessionManager"regionName="gemfire_modules_sessions"/>}}
> *Step 3: Update Application Code*
>  * Change all {{javax.servlet.*}} imports to {{jakarta.servlet.*}}
>  * Recompile application
> ----
> h2. Deliverables
>  * [ ] {{geode-modules-tomcat10}} module (source code)
>  * [ ] {{geode-modules-tomcat11}} module (source code)
>  * [ ] Build artifacts (JARs)
>  * [ ] Unit test suite
>  * [ ] Integration test suite
>  * [ ] User documentation
>  * [ ] Migration guide
>  * [ ] Sample applications
>  * [ ] Performance benchmark results
> ----
> h2. Notes
> h3. *Tomcat 10 vs 11 Differences*
>  * {*}Tomcat 10.1{*}: Jakarta EE 10, Servlet 6.0
>  * {*}Tomcat 11{*}: Jakarta EE 11, Servlet 6.1 (minor updates)
>  * Most code should be *identical* between Tomcat 10/11 modules
>  * Consider single codebase with multi-version build
> h3. *Recommended Approach*
>  # Start with Tomcat 10 support (more stable)
>  # Validate with extensive testing
>  # Add Tomcat 11 support (mostly copy Tomcat 10)
>  # Share maximum code via {{geode-modules-session}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to