I have the following situation:
I have 2 JVM processes (really 2 java
processes running separately, not 2 threads) running on a local machine. Let's call them ProcessA
an ProcessB
.
I want them to communicate (exchange data) with one another (e.g. ProcessA
sends a message to ProcessB
to do something).
Now, I work around this issue by writing a temporary file and these process periodically scan this file to get message. I think this solution is not so good.
What would be a better alternative to achieve what I want?
Multiple options for IPC:
Without more details, a bare-bone network-based IPC approach seems the best, as it's the:
That being said, based on your example (simply requesting the other process to do an action), JMX could also be good enough for you.