Grunzwanzling Grunzwanzling - 30 days ago 8
Java Question

Best way to transmit data between two applications

What is the best way to transmit data between two (Java) applications running on the same machine? One obvious idea would be to use standard Sockets but this doesn't feel right.

I've heard that most operating systems have a built-in system specifically for this task. How is it called and how does it work?

And is there any other good method to do something like that?

Answer Source

I think it depends on what you want to communicate between the applications and the size of your project. Some examples:

  • Sharing of state - use a database, files or similar
  • Messaging - use a socket. On top of a socket you have several technologies you can leverage, like HTTP/REST, but you can also create your own transport

There are also message applications you can leverage, like RabbitMQ