问题描述
是否有一种很好的方法可以在群集中运行的Java Web应用程序中获取登录用户数?
Is there a good way to get the logged in user count in a Java web application that is running in a cluster?
我写了一个简单的 HttpSessionListener
带有静态字段,但我想这在集群中不起作用。我可以看到有一个Spring Security解决方案,但我在一些论坛中读到这在群集中仍然不行。
I wrote a simple HttpSessionListener
with a static field, but I suppose this doesn't work in cluster. I can see there is a Spring Security solution, but I read in some forums that this is still not ok in cluster.
我必须实现此用户的产品count正试图独立于应用程序服务器,目前我们支持Tomcat,Weblogic和JBoss。目前我需要一个Weblogic 10.3集群的解决方案。
The product in which I have to implement this user count is trying to be application server independent, currently we support Tomcat, Weblogic and JBoss. At the moment I need a solution for Weblogic 10.3 clusters.
推荐答案
您可以在数据库中维护计数器,这将在集群环境中工作。
You can maintain the counter in database which will work in cluster env.
这篇关于集群中的用户(会话)计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!