File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inter-process communication between two JVMs

 
Michael Andro
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

I want two JVMs to communicate with each other. I got some suggestions on this topic, however, I am not absolutely sure what to use. The communication is quite simple, it is one JVM running the web application with Tomcat and one JVM is the backend system calculating some stuff. Now I want to use the web application to invoke the calculation to start on the other JVM. It is quite simple, and there is mere information to exchange.

RMI seems a bit overpowered for this task. The suggesstion was JMS and sockets so far. But on what base should I decide which to use?

Best regards,
Michael
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the requirements? JMS is asynchronous (and implies the existence of a messaging server), while sockets work synchronously - it's hard to picture a scenario where both approaches are equally adequate.
 
Michael Andro
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I see the difference. These requirements were not considered yet. Maybe the backend system should run some request which were invoked by the web application.

So, what I say, the possibility is there, that the backend system is running an algorithm, meanwhile the web application sends a new request, which has to be dealt with. This is what I understand to asynchronrous communication, request are invoked even so the backend system is not listening at the moment.

However, I don't see the point how this cannot be realizes with a socket through concurrent execution.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The web app could certainly use a socket to shoot the request to the app server, then close the socket after it got some kind of ID from the app server, and finally -some time later, most likely as part of a different request it is serving- re-contact the app server with the ID to find out if the results are in. That would make the communication sort of asynchronous.
 
Michael Andro
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I will go for sockets. Do I have to connect/listen the socket to localhost/127.0.0.1 or is there an alternative path suggested?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic