By "local" I mean both run in the same subnet, in most cases the same host/VM, therefore some standard cross-network cross-platform RPC mechanisms like SOAP, XML-RPC, CORBA, etc. seem unnecessary.
The payload is mainly numerical (mostly tabulated) data with some small amount of meta data (for example available data services, data description/type, etc.) from C++ to Java, and console/scripted UI events from Java to C++. So the C++ program acts like the server and Java program the client.
I can enumerate several options (mostly from searching this wonderful site) but I've never used or seen one in a real-world heavy-duty situation, so I really hope someone who's "been there, done that" can educate me about the pros and cons of the options.
- Shared memory
- Pipe, stdin/stdout, etc.
- Custom data structure over plain socket (probably UDP) (this question)
- Messages over plain socket, could be Google protocol buffer, Thrift, JSON, etc. (this answer, among others)
- Java RMI with C++ RMI server (this question)
- JNI (some answers in this question)
I'm pretty sure I've missed many options. Thank you all for your help!
Edited: I forgot to mention that performance is not a major concern as the data throughput is not expected to be huge (server is heavily database-bound), but it would be important to know if one option stands out to be much faster or slower. For example, I suppose nothing beats shared memory (if done right).