0

I have a simple python function that I need to run as a web service from a tomcat server. This is the setup I got as an external requirement from my client and I cannot change it. I've managed to make this work with CGI, but I would like to optimise it and have encountered the following snippet on the uWSGI documentation that gives me hope:

The included servlet can be used to forward requests from Tomcat to the uWSGI server. It is stable, but currently lacks documentation.

There is currently no commercial support for this handler.

I'm new to uWSGI, so I'm not sure where is this servlet included. Can anyone point me to it? Have you managed to use this connection, and if so - how? If not, pointing to the proposed servlet (possibly in the uWSGI distribution or source) would be enough of a starting point for me.

I've seen that people have used nginx to proxy between tomcat and uWSGI, but for obvious reasons I'd prefer to try not to do that. Additional clarification following comments: In fact, the setup should not depend on launching python as an independent from tomcat process.

mapto
  • 121
  • 5
  • I know this is not really any help but my inclination would be to always proxy an application server, whether tomcat or uwsgi, as it will be less painful in the long run. My guess would be that the servlet acts as a URL handler to forward to the uWSGI process but it may be a case of reading the code to work out how it works. – Simon Greenwood Dec 22 '17 at 10:25
  • @SimonGreenwood, my understanding is that from my client's Java perspective, they wouldn't want to care about launching any scripts that cannot be managed with maven/tomcat. The CGI interface appears to them this way (as long as the OS knows how to execute the python script). – mapto Dec 22 '17 at 11:36
  • A clarification on the original text at the uWSGI website: Now I figured that they refer to a servlet, included in Tomcat to forward requests to the HTTP socket served by uWSGI (as a standalone server). Here's a discussion on how Tomcat can do that: https://stackoverflow.com/q/10860569/1827854 However, it seems the _included_ servlets might not be the easiest approach. – mapto Apr 12 '18 at 07:24

0 Answers0