Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parallel Deployment on Tomcat with open sockets?

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?

like image 451
membersound Avatar asked Feb 25 '16 08:02

membersound


People also ask

Can we deploy multiple applications in Tomcat?

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.

What is Tomcat docBase?

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.

What is the use of server XML in Tomcat?

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.


1 Answers

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.

like image 123
Ioannis Baourdos Avatar answered Nov 15 '22 11:11

Ioannis Baourdos