开发者

Crash-resistant Java IPC

开发者 https://www.devze.com 2023-03-01 03:31 出处:网络
I have a Java program which depends on a native library that crashes randomly (and therefore bring down the whole JVM).

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 f开发者_StackOverflow社区rom 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)

0

精彩评论

暂无评论...
验证码 换一张
取 消