my dog learned polymorphism
The moose likes Tomcat and the fly likes Using attribute jvmRoute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Using attribute jvmRoute" Watch "Using attribute jvmRoute" New topic

Using attribute jvmRoute

Royston Nadar

Joined: Jul 26, 2011
Posts: 6


In Tomcat's server.xml file, there's a Engine tag with attribute jvmRoute, like this :
<Engine name="Catalina" defaultHost="svr-myapp1" jvmRoute="server1">

Based on my research, I know this attribute is used in conjunction with the Apache load balancer. In the project which I currently working on, load balancing of two Tomcat servers is done by F5 Network, and it doesn't use the jvmRoute attribute. My question is, is it safe to just add this attribute in the server.xml, or will this have consequences?

The reason is need the jvmRoute attribute is because I'm need to store all session IDs created by the container in the DB. With jvmRoute, I can differentiate the session ID whether they were created by server1 or server2. Attribute jvmRoute will append the string specified in every session IDs created, for e.g D3743GDUI38484.server1. I would also appreciate any other suggestion to make server indicator appear with the session ID. Thanks.

Volker Weinberger

Joined: Nov 07, 2011
Posts: 2

as you already wrote, tomcat will add the jvmRoute to the JSESSIONID (<JSESSIONID>.<JVMROUTE>). If that is no problem for the F5 Network than i would
say there is no consequence.

Royston Nadar

Joined: Jul 26, 2011
Posts: 6

Thanks Volker. I will decide whether to proceed the changes.
I agree. Here's the link:
subject: Using attribute jvmRoute
It's not a secret anymore!