JBoss 与 Tomcat 的再次对比 [英] JBoss vs Tomcat again

查看:29
本文介绍了JBoss 与 Tomcat 的再次对比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个古老的问题(它是:))Tomcat 和 JBoss 之间哪个服务器更好,但我还没有找到足够好的答案来解决我的问题.

This will appear to be the age old question (which it is :)) that which server is better between Tomcat and JBoss, but I have not found a good enough answer yet to solve my problem.

我知道 Tomcat 只是一个 servlet 引擎,而 JBoss 提供了更多开箱即用的功能,但我不明白为什么 Tomcat 在某些情况下比 jboss 更适合使用.我在某处读到 JBoss 具有可插拔架构,如果需要,您可以从 JBoss 中拔出功能,使其本质上成为一个 tomcat servlet 容器.如果是这种情况,那么这样做而不是使用 Tomcat 是不是更好,以便为回插事情留出空间.

I know that Tomcat is only a servlet engine and JBoss offers many more functionalities out of the box, but what I fail to understand is why Tomcat is better to use in some situations than jboss. I read somewhere that JBoss has a pluggable architecture and if required, you can unplug features from JBoss to make it essentially a tomcat servlet container. If that is the case, then isn't it better to do so instead of using Tomcat, in order to leave scope for plugging things back.

我认为 Tomcat 的另一个解释是它是轻量级的,这是否意味着更少的内存需求,或者是否也允许更快的响应.同样,我需要知道 jboss 不会根据要求加载组件,即如果我只使用 servlet,那么 jboss 不会跳过其余功能并自动变得轻量级.

Another explanation I find in favour of Tomcat is that it is lightweight, does that mean less memory requirement or does that also allows faster response. Again, I need to know that won't jboss load components as per requirement i.e. if i am using only servlets, then won't jboss skip the rest of the features and become lightweight automatically.

本质上,我的应用程序没有任何 Java EE 功能,但是由于上述原因,支持 Tomcat 的轻量级"论点听起来不够令人信服.

Essentially, my application does not have any Java EE features, but the 'lightweight' arguments in favour of Tomcat does not sound convincing enough because of the above mentioned reasons.

请帮忙.

当时我们终于决定使用tomcat,我们已经使用了6个多月,非常好用.事实上,我们发现了一些实际用途,我们可以很容易地在同一台服务器机器上为不同的开发人员运行多个 tomcat 实例,而 jboss 可能会非常困难.

We had finally decided to use tomcat back then and we have been using it for more than 6 months now with great ease of use. Infact we found some practical use where we could very easily run multiple tomcat instances on the same server machine for different developers, the same could have been very difficult with jboss.

我发现 tomcat 对我们的工作来说很轻松,因此当您不使用很多 Java EE 功能时,tomcat 可能是正确的选择.PS:请注意,我们仍然使用 Spring 和 Hibernate with Tomcat

I have found tomcat to be hassle free for our work and therefore may be the right choice when you are not using much of Java EE features. PS: Please note that we still use Spring and Hibernate with Tomcat

推荐答案

首先是事实,两者都不是更好.正如您已经提到的,Tomcat 提供了一个支持 Servlet 规范的 servlet 容器(Tomcat 7 支持 Servlet 3.0).JBoss AS,一个完整的"应用服务器,在其当前版本中支持 Java EE 6(包括 Servlet 3.0).

First the facts, neither is better. As you already mentioned, Tomcat provides a servlet container that supports the Servlet specification (Tomcat 7 supports Servlet 3.0). JBoss AS, a 'complete' application server supports Java EE 6 (including Servlet 3.0) in its current version.

Tomcat 相当轻量级,如果您需要除 Servlet API 之外的某些 Java EE 功能,您可以通过提供所需的库作为应用程序的一部分来轻松增强 Tomcat.例如,如果您需要 JPA 功能,您可以包含 Hibernate 或 OpenEJB,并且 JPA几乎开箱即用.

Tomcat is fairly lightweight and in case you need certain Java EE features beyond the Servlet API, you can easily enhance Tomcat by providing the required libraries as part of your application. For example, if you need JPA features you can include Hibernate or OpenEJB and JPA works nearly out of the box.

如何决定是使用Tomcat还是全栈Java EE应用服务器:

How to decide whether to use Tomcat or a full stack Java EE application server:

在开始您的项目时,您应该知道它需要什么.如果您在大型企业环境中,JBoss(或任何其他 Java EE 服务器)可能是正确的选择,因为它提供了对例如的内置支持:

When starting your project you should have an idea what it requires. If you're in a large enterprise environment JBoss (or any other Java EE server) might be the right choice as it provides built-in support for e.g:

  1. 用于异步集成的 JMS 消息传递
  2. Web 服务引擎(JAX-WS 和/或 JAX-RS)
  3. 管理功能,如 JMX 和脚本化管理界面
  4. 高级安全性,例如与 3rd 方目录开箱即用的集成
  5. EAR 文件而不是仅"WAR 文件支持
  6. 我不记得所有其他伟大的"Java EE 特性:-)

在我看来 Tomcat 非常适合以 Web 为中心、面向用户的应用程序.如果后端集成发挥作用,那么(至少)应该考虑 Java EE 应用服务器.最后但并非最不重要的一点是,将为 Tomcat 开发的 WAR 迁移到 JBoss 应该是 1 天的练习.

In my opinion Tomcat is a very good fit if it comes to web centric, user facing applications. If backend integration comes into play, a Java EE application server should be (at least) considered. Last but not least, migrating a WAR developed for Tomcat to JBoss should be a 1 day excercise.

其次,您还应该考虑环境中的使用情况.如果您的组织已经运行了 1,000 个 JBoss 实例,那么无论您的具体要求如何(考虑运营成本或技能提升等方面),您都可能会一直使用它.当然,反之亦然.

Second, you should also take the usage inside your environment into account. In case your organization already runs say 1,000 JBoss instances, you might always go with that regardless of your concrete requirements (consider aspects like cost for operations or upskilling). Of course, this applies vice versa.

我的 2 美分

这篇关于JBoss 与 Tomcat 的再次对比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆