Search code examples
javaweb-servicessocketsrmirpc

how to send data from one java program to another


We have a use case to:

  1. start a java program from another java program.
  2. Once the second java program is invoked, send a data-stream from the first java program to the second.

I checked that we can use sockets/rpc for it. I also saw that RMI/web-services are available and now confused with everything.

Could somebody point me to some good documentation about how to do this ?

Thanks in advance


Solution

  • RMI is going to be your simplest choice here (2 java programs running on the same box). streaming data over rmi is not straightforward, however i've written the RMIIO library which makes that fairly easy.