简体   繁体   English

防撞Java工控机

[英]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).我有一个 Java 程序,它依赖于一个随机崩溃的本机库(因此导致整个 JVM 崩溃)。 This library is about I/O, therefore can be easily isolated from the rest of the program with a second JVM.这个库是关于 I/O 的,因此可以很容易地与第二个 JVM 的程序的 rest 隔离。 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?问题是:让这 2 个 JVM 通信的最佳方式是什么? 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).其中一个将崩溃并重新启动,但这不应影响另一个 JVM(除了由于崩溃和重新启动而导致 I/O 出现一些超时)。 Is RMI crash resistant? RMI 是否抗碰撞? Should I use a socket?我应该使用插座吗? A memory-mapped file?内存映射文件?

I would use a persistent JMS Queue between the processes.我会在进程之间使用持久的 JMS 队列。 This will be the most crash resistent.这将是最抗碰撞的。 (Fixing the library is the best option) (修复库是最好的选择)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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