Hi, As a part of session stickness I need to know which tomcat the request is routed to. Is there any way I can know that ?
I have a tomcat running with two clusters.
or is there any other way I can test the session stickiness
posted 7 years ago
For only testing purpose, you can write a filter in your web app which would have a static final variable [string/int]. This variable can have a different value depending upon the server on which the web app is deployed. Map this filter to the url-pattern "/" and keep printing the variable to the console for every request.
Thereafter, keep requesting your server cluster. To test stickiness, bring down a server which has active sessions. If you keep requesting from the same session, then the console should indicate that a different server is catering to the request while at the client side the session doesn't appear to be destroyed. [ September 30, 2008: Message edited by: Anirvan Majumdar ]