java - Prioritze between http requests with tomcat - Stack Overflow
Priority seems like a strange concern in a multi-threaded environment. I don't believe there is anything in the servlet spec that would do what you're looking for.
The thread priority seems like the only solution to me. Tomcat allows you to specify the priority of each thread in an executor's thread pool: http://tomcat.apache.org/tomcat-7.0-doc/config/executor.html
You would need to somehow route requests for each interface to the appropriate connector. That would need to be done outside of Tomcat, perhaps with Apache or nginx. If you have a load balancer, that may be an interesting place to do that sort of routing.
You could also give a larger thread pool to the higher priority interface instead of messing with thread priorities. But I'm not quite sure about what you are trying to prioritize.
Read full article from java - Prioritze between http requests with tomcat - Stack Overflow
No comments:
Post a Comment