File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which tomact request is routed to ?

 
Kiran Kumar Chitturi
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 261
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic