Java - 热部署 [英] Java - Hot deployment
问题描述
有很多方法可以在Java世界中实现热部署,所以你这可能需要更具体地反映你的上下文和你想要实现的目标。
这里有一些很好的潜在客户/选择:
- OSGi 是一个支持热部署的通用模块系统
- Clojure 是一种动态JVM语言,实现了很多运行时交互。 Clojure经常用于实时编码 - 几乎任何东西都可以在运行时被热交换和重新定义。 Clojure是一种强调不变性和并发性的功能语言,所以在某些方面与Erlang有一些有趣的相似之处。 Clojure有一些非常好的网络框架,如 Noir ,适合热插拔网络代码。
- Play Framework 旨在为生产力原因启用热插拔代码(避免重新启动Web服务器)。如果您主要关注热插拔Web应用程序,可能会相关。
- 大多数Java应用服务器,如 JBoss 支持某些形式的热插拔Web应用程序。
Recently, I was reading book about Erlang which has hot deployment feature. The deployment can be done without bringing the system down. All the existing requests will be handled by old version of code and all the new request after deployment will be served by the new code. In these case, both the versions of code available in runtime for sometime till all the old requests are served. Is there any approach in Java where we can keep 2 versions of jar files? Is there any app/web servers support this?
There are many ways to achieve hot deployment in the Java world, so you'll probably need to be a bit more specific bout your context and what you are trying to achieve.
Here are some good leads / options to consider:
- OSGi is a general purpose module system that supports hot deployment
- Clojure is a dynamic JVM language that enables a lot of runtime interactivity. Clojure is often used for "live coding" - pretty much anything can be hot-swapped and redefined at runtime. Clojure is a functional language with a strong emphasis on immutability and concurrency, so in some ways has some interesting similarities with Erlang. Clojure has some very nice web frameworks like Noir that are suitable for hot swapping web srever code.
- The Play Framework is designed to enable hot swapping code for productivity reasons (avoiding web server restarts). Might be relevant if you are looking primarily at hot-swapping web applications.
- Most Java applicatio servers such as JBoss support some form of hot-swapping for web applications.
这篇关于Java - 热部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!