-
1. Re: Wildfly Active Sessions
pferraro Dec 9, 2019 3:54 PM (in response to shubhmeetkaur6)Via the CLI, obtain the number of active sessions is exposed. e.g.
[standalone@embedded /] /deployment=foo.war/subsystem=undertow:read-attribute(name=active-sessions) { "outcome" => "success", "result" => 0 }
Programmatically, you can call undertow/SessionManager.java at master · undertow-io/undertow · GitHub
You can obtain a reference to the Undertow SessionManager via the UndertowDeploymentService which has a getDeployment() method which returns an Undertow Deployment, from which you can call getSessionManager().getActiveSessions();
-
2. Re: Wildfly Active Sessions
shubhmeetkaur6 Dec 10, 2019 6:09 AM (in response to pferraro)Hi Paul,
I need to find the JSessionId linked with these active Sessions, rather than the count, i want a detailed info tied with this session.
Thanks for the help.
-
3. Re: Wildfly Active Sessions
pferraro Dec 10, 2019 7:43 AM (in response to shubhmeetkaur6)What you asking for is the equivalent of HttpSession.getSessionContext().getId(), which was deprecated in Servlet 2.1 for security reasons.
Thus, you can achieve this programmatically through the use of internal Undertow classes, following the instructions above.
-
4. Re: Wildfly Active Sessions
shubhmeetkaur6 Dec 11, 2019 8:40 PM (in response to pferraro)Hey Paul,
How can i get access to UndertowDeploymentService or Undertow SessionManager programatically?
Shubhmeet
-
5. Re: Wildfly Active Sessions
ctomc Dec 12, 2019 4:05 AM (in response to shubhmeetkaur6)write a ServletExtension http://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#servlet-extensions