请注意,这与并发用户会话无关,而是与可存储在内存中的会话总数有关。
以下是日志:
java.lang.IllegalStateException: Max sessions limit reached: 10000
at org.springframework.web.server.session.InMemoryWebSessionStore$InMemoryWebSession.checkMaxSessionsLimit(InMemoryWebSessionStore.java:276)
at org.springframework.web.server.session.InMemoryWebSessionStore$InMemoryWebSession.save(InMemoryWebSessionStore.java:251)
at org.springframework.web.server.session.DefaultWebSessionManager.save(DefaultWebSessionManager.java:123)
at org.springframework.web.server.session.DefaultWebSessionManager.lambda$null$0(DefaultWebSessionManager.java:88)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:272)
at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:230)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:236)
您可以在此处找到Spring文档https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/server/session/InMemoryWebSessionStore.html
我创建了一个如下所示的bean,但不确定:
@Bean
public InMemoryWebSessionStore inMemoryWebSessionStore() {
InMemoryWebSessionStore inMemoryWebSessionStore = new InMemoryWebSessionStore();
inMemoryWebSessionStore.setMaxSessions(-1);
return inMemoryWebSessionStore;
}
1条答案
按热度按时间5lhxktic1#
我终于找到了一个对我有效的解决办法。