aspose file tools*
The moose likes Tomcat and the fly likes Which tomact request is routed to ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Which tomact request is routed to ?" Watch "Which tomact request is routed to ?" New topic
Author

Which tomact request is routed to ?

Kiran Kumar Chitturi
Greenhorn

Joined: Jan 28, 2007
Posts: 4
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
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
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 ]
 
Consider Paul's rocket mass heater.
 
subject: Which tomact request is routed to ?