I'm using Tomcat with parallel deployment for updating my application.
Problem: my app opens a socket on a fixed port. So when I deploy an addition application like myapp##2.war
, this would try to open the same socket as myapp##1.war
.
Question: is it possible that Tomcat itself opens a socket, and then delegates any incoming requests to the specific port the application opened? So that from the outside always the same port is accessibly, even though internally this is routed to different ports?
Simply drop both war files into Tomcat's webapps folder. That is all you need to do. By default, Tomcat expands ("explodes" some say) each war (technically a zip file) into a folder and automatically deploys the app for you. This happens on the fly if Tomcat is already running, or on startup when you launch Tomcat.
The docBase attribute is a path to the WAR file or exploded deployment directory. It is relative to the webapps directory, although an absolute path can be used. The path attribute is the one we are most interested in, as it defines the context path of the application.
XML. The server. xml file is Tomcat's main configuration file, and is responsible for specifying Tomcat's initial configuration on startup as well as defining the way and order in which Tomcat boots and builds. The elements of the server.
I am not quite certain on the topology, communication flow and actual use case but I would suggest you deploy something between your web app(s) and the actual remote socket. have a loop at Apache Camel (which can be deployed via tomcat if I am not mistaken) and can deal with the socket connection, giving you higher level endpoints for your WARs. check the netty socket connector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With