简体   繁体   English

使用Java 6的嵌入式http服务器进行IPC

[英]Using Java 6's embedded http server for IPC

I am considering using Java 6's embedded HTTP server for some sort of IPC with a Java daemon. 我正在考虑将Java 6的嵌入式HTTP服务器用于某种带有Java守护进程的IPC。 It works pretty well and it's nice that's already bundled with all Java 6 installations. 它工作得很好,很好,它已经与所有Java 6安装捆绑在一起。 No need of additional libraries. 无需额外的库。

However, I would like to know if someone has tried this with production environments with heavy load. 但是,我想知道是否有人在负载较重的生产环境中尝试过此操作。 Does it perform well? 它表现良好吗? Should I be looking for something more robust such as Tomcat or Jetty? 我应该寻找更强大的东西,如Tomcat或Jetty吗?

Well, as much as it saddens me to say bad things about Java, I'd really not recommend it for production use, or any kind of heavy use scenario. 好吧,尽管让我不得不说出关于Java的坏事,但我真的不推荐它用于生产用途或任何类型的大量使用场景。 Even though it works well for small stuff like unit/integration tests, it has big memory issues when it is used intensivelly, especially when you use it for a big number of connections at once. 尽管它适用于单元/集成测试这样的小东西,但是当它被密集使用时会有很大的内存问题,特别是当你同时使用它进行大量连接时。 I've had similar issues to the ones described here: 我遇到过类似问题:

http://neopatel.blogspot.com/2010/05/java-comsunnethttpserverhttpserver.html http://neopatel.blogspot.com/2010/05/java-comsunnethttpserverhttpserver.html

And Jetty is not that good for heavy production usage for pretty much the same reason. 而出于同样的原因,Jetty并不适合大量生产。 I'd go with Tomcat if I were you. 如果我是你,我会和Tomcat一起去。

As an alternative, I believe you could consider Java Messaging Service as an alternative to Inter Process Communications and just have a JMS server running (like Active MQ) 作为替代方案,我相信您可以将Java Messaging Service视为Inter Process Communications的替代方案,并且只运行JMS服务器(如Active MQ)

如果你想要Java附带的东西看看RMI或RMI / IIOP。

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

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