[英]Communication between java spring server and python applications
I designed my java spring application to run a couple of python programs on same server and communicate with them.我设计了我的 java spring 应用程序来在同一台服务器上运行几个 python 程序并与它们通信。 I run them with ProcessBuilder and communicate via InputStream/OutputStream.
我使用 ProcessBuilder 运行它们并通过 InputStream/OutputStream 进行通信。
Now I want to achieve that when I restart or shut down my java application, python apps didnt close.现在我想实现这一点,当我重新启动或关闭我的 java 应用程序时,python 应用程序没有关闭。 I can't get Process object by PID.
我无法通过 PID 获取 Process object。 With ProcessHandler object I can't get input/output streams.
使用 ProcessHandler object 我无法获得输入/输出流。 It seems that i should use some other mechanism of IPC.
看来我应该使用其他IPC机制。 So the questions are:
所以问题是:
Thanks in advance, sorry for poor language:)在此先感谢,抱歉语言不好:)
I give some suggestion on our project experience:我对我们的项目经验提出一些建议:
In single server, use docker-compose to run/stop app no matter using java or python.在单服务器中,无论使用 java 还是 python,都可以使用 docker-compose 运行/停止应用程序。 In multi-server,they will be deployed in Istio.
在多服务器中,它们将部署在 Istio 中。
use Restful protocol to communicate between them.使用 Restful 协议在它们之间进行通信。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.