java - How to programmatically determine which (load balanced) tomcat server the webapp is running on -
i have webapp running on 2 load balanced tomcat servers. what's best way app determine server it's running on?
while can tell sessionid server it's running on (as .jvm1 , .jvm2 appended), how can similar information in background task (scheduled via spring's @scheduled annotation)?
it might overkill , if there's way it's better, might able query tomcat engine mbean , it's jvmroute
property. mbean usually called catalina:type=engine
or catalina:type=engine,service=something
(see here more details).
Comments
Post a Comment