2

我有一个基于弹簧云的应用程序,它将弹簧会话存储在 redis 中。它使用带有嵌入式 tomcat 的 Spring Boot。

使用弹簧执行器时,/metrics 端点不会返回任何有价值的信息。httpsessions.active 设置为 0,httpsessions.max 设置为 -1。

我猜这是因为 spring 用自己的 spring session 实现替换了 httpsession 实现。

有没有办法从某个端点访问这些信息?最好使用 JMX,但不是强制性的。

谢谢。

4

1 回答 1

0

我最终通过使用通用用户名使用了以下解决方案。端点将返回所有会话,一个简单的计数将给出总数。

http://docs.spring.io/spring-session/docs/current/reference/html5/guides/findbyusername.html

于 2016-12-22T08:54:02.420 回答