Spring Webflow应用在Redis外部化会话的多节点OpenLiberty中运行异常求助
Spring Webflow迁移OpenLiberty多节点Redis会话同步问题
作为云迁移项目的一部分,我们正将Spring Webflow应用从WebSphere App Server迁移至OpenLiberty WebProfile 8。为验证可行性,构建了一个包含2个流程(各含2个页面)的简单WAR包(基于Webflow 2.4),采用2节点部署+Redis外部化会话实现高可用,配置参考《Configuring Open Liberty or WebSphere Liberty Session Persistence With JCache and Redis》一文。
该PoC应用在单节点环境运行正常,但从同一浏览器跳转至另一节点服务器时,虽能正常显示首页面且会话变量值正确,但跳转至下一页时,出现无法获取第二个快照的报错。
注意事项
- PoC使用Redis社区版而非专业版;
- WebSphere Liberty开发者版本下问题复现;
- 相同PoC在Tomcat+Redis社区版的多节点外部化会话环境下运行正常。
环境版本与配置
- Liberty:webProfile8-24.0.0.5(Windows 64位)
- JDK:1.8.0_151(Windows 64位)
- Redis:3.2.100 Windows 64位
- Tomcat:8.5.87(Windows 64位)
Liberty server.xml配置
<?xml version="1.0" encoding="UTF-8"?> <server description="new server"> <!-- Enable features --> <featureManager> <feature>webProfile-8.0</feature> <feature>sessionCache-1.0</feature> </featureManager> <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" --> <httpEndpoint id="defaultHttpEndpoint" httpPort="9085" httpsPort="9433" /> <!-- Automatically expand WAR files and EAR files --> <applicationManager autoExpand="true"/> <library id="jCacheVendorLib"> <file name="${shared.resource.dir}/redisson-all-3.25.2.jar"/> <file name="${shared.resource.dir}/fst-2.57.jar"/> </library> <httpSessionCache cacheManagerRef="CacheManager"/> <cacheManager id="CacheManager" uri="file:${server.config.dir}/redisson.yaml"> <properties fallback="true"/> <cachingProvider jCacheLibraryRef="jCacheVendorLib"/> </cacheManager> <logging traceSpecification="*=audit:org.springframework.webflow.*=finest"/> </server>
Redis redisson.yaml配置
singleServerConfig: idleConnectionTimeout: 10000 connectTimeout: 10000 timeout: 3000 retryAttempts: 3 retryInterval: 1500 password: null subscriptionsPerConnection: 5 clientName: null address: "redis://127.0.0.1:6379" subscriptionConnectionMinimumIdleSize: 1 subscriptionConnectionPoolSize: 50 connectionMinimumIdleSize: 1 connectionPoolSize: 5 database: 0 dnsMonitoringInterval: 5000 threads: 16 nettyThreads: 32 codec: !<org.redisson.codec.FstCodec> {} transportMode: "NIO"
恳请有相关经验的人士提供解决方案。
内容的提问来源于stack exchange,提问作者skvp
相关产品推荐
相关产品推荐

