This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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 ]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Which tomact request is routed to ?
 
It's not a secret anymore!