简体   繁体   中英

Crash-resistant Java IPC

I have a Java program which depends on a native library that crashes randomly (and therefore bring down the whole JVM). This library is about I/O, therefore can be easily isolated from the rest of the program with a second JVM. I want to split the program in two so that the main program keeps running, but the native library can be restarted after crash. The question is: what is the best way to let these 2 JVM communicate? One of them will crash and be restarted but this should not affect the other JVM (besides some timeout with the I/O because of the crash and restart). Is RMI crash resistant? Should I use a socket? A memory-mapped file?

I would use a persistent JMS Queue between the processes. This will be the most crash resistent. (Fixing the library is the best option)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM