domingo, 7 de abril de 2013

Jboss 7: a love–hate relationship


I've been using JBoss Application Server professionally since 2002. During this period, I've also used Tomcat, Jetty, Glassfish, IBM WebSphere and the already dead OC4J. Between these options I would say my personal choice always was JBoss. Do not misunderstand me; Tomcat and Jetty are both great and lightweight web containers. But the point of this post is not to discussion anyone's preferences, but my experiences with the new version of JBoss Application Server (AS).


First of all, I would like to discuss the good points and improvements JBoss 7 has over its older versions. So, my "loves" are:
  • Strict Java EE 6 compliant
    • Reduce vendor locked once JBoss development team has chosen to implement “only” the JavaEE spec.
  • Completely redesigned architecture (very welcome)
    • Modular design
      • Say goodbye to microcontainers
      • They have created an abstraction built on top of OSGI
      • According to JBoss guys, it is “prepared to support Jigsaw”
    • Modular dependencies
      • Best way to manage your app dependencies
    • Modular classloading
      • Say goodbye to the UnifiedClassloader. \o/
      • classloading happens on demand
  • Two execution modes
    • standalone
      • Normally used for development
      • Allows to organize and manage your cluster(s) as you are already used to
    • domain
      • Allows to organize and manage your cluster(s) in an easy and centralized way
  • Better security support
    • Allows to provide separate inet interfaces for apps and management consoles
  • Central point of configuration
    • the whole configuration is centralized in only one file (or two for domain mode)
    • Profile definition are easier and “smarter”
      • It simplifies a lot the AS slimming. \o/
      • If you do not use a specific feature, JBoss do not load it
      • You can reuse profile definitions. There is no need to be coping jars around anymore. \o/
  • Better management solutions
    • Simple and easy management interfaces
      • Web Console (GWT) with only the most important data
      • Rest interface
      • Command line
      • JMX (actually I’ve never used this, there is no need any more)
    • A centralized management interface for domain mode
    • Persistent configuration through any management interface available
      • Remember... In older versions of JBoss, the configuration through jmx-console was transient. So, this is a very welcome feature
  • Faster startup
    • Modules were optimized to minimize the startup time
    • Modules and packages are indexed
    • Only required modules are loaded
      • JBoss knows your dependency graph, so there is no reason to load JMS module, for example, if you do not use it. Even though you have configured it to be loaded. Actually, it seems to work pretty well.
    • Parallel startup
      • Once JBoss 7 knows your dependency graph, it can use all cores to start your apps
      • To resolve correctly your dependencies in older versions of JBoss, you have to inform the order you apps must start. So there was no way to start them parallelly
  • Memory diet
    • As we have seen before, only required modules are loaded
      • This means, less memory usage
      • Less memory usage == better scalability and performance, once you will have more free memory available and less Full GC executions during runtime
  • Better support for integration tests through Arquillian

Besides all these good stuff, let me show my "hates":
  • Strict Java EE 6 compliant
    • Wait.. You should be thinking: “at first you said it was a good stuff, and now a bad stuff?!?!”. The reason for this is that there are functionalities which are impossible to implement using pure Java EE spec and, most of them, were removed. :-(.  Some of them, community yell so much they have decided to add an alternative. Take as an example Container Interceptors which is coming in JBoss AS 7.2 / JBoss EAP 6.1
  • Completely redesigned architecture
    • Again.. the new design modular is wonderful, but for those who would like to migrate from an older versions of JBoss, will notice it is not as easy and seamless as it should be
  • No backward compatible in JBoss specific features
    • JBoss 7 has broken compatibility with everything that was not in JavaEE spec. So if you use JBoss specific features, be careful, your migration may be more complex than you think it would be
  • No JBoss AOP any more :-(
  • The migration documents are useless
    • The difficulties we have faced do not fit in this post, so I’m planning to write one or more posts to help community understand what they will be facing during the JBoss migration
  • Annoying bugs deploying applications through management consoles
    • Although I think the fix would be coming, it has been forcing us to restart the server at each deploy
  • JBoss EAP Alpha
    • The community version of JBoss (i.e. JBoss AS) will now be called as JBoss EAP Alpha. Why?!? Marketing purpose, of course. Imagine you saying to a client they should be using an Alpha version in production
      UPDATED: Just received an e-mail from Red Hat saing
      • JBoss AS, is now called Wildfly. See by yourself
  • JBoss EAP Alpha is not as stable as the JBoss AS Final
    • Although they say EAP Alpha is stable as the AS Final, it is not complete true. If you take a quick look on JBoss modules, you will easily notice they are using unfinished/unstable libraries.
      • For example, JBoss EAP 6 Alpha is bundled with hibernate-core-4.2.0.CR1. I don’t recall any CR lib in older versions of JBoss AS.
      • Obviously it is very ease to people with certain knowledge to modify. But most of people will be using JBoss without any module structure change, for sure.
  • Domain controller is not fault tolerant
    • Whenever the domain controller dies, other nodes cannot be restarted or managed. If you try to restart them, they will give you an error saying they cannot connect to domain controller. Hope the fix would be coming.
  • Does not provide load balancing for EJB Timer
    • Only fault tolerance
    • In some clients, we were forced to keep using quartz because the huge number of jobs they have
  • Last, but not least. JBoss EAP support is a pain in the ass
    • I will make no comments about this. Just try by yourself you will understand what I’m talking about.
    • My advice is: be prepared, mainly if you have gastritis. :-)

Even with all these issues, I still think JBoss 7 / EAP 6 is one of the best application server available, but I think the move Red Hat is taking would be pushing the community away from them. Actually, I know people which are looking for Jboss alternatives. Some friends are working in a migration from JBoss 5.1 to TomEE, another once told me: “if I have to pay for an Application Server, I will be paying for a WebLogic”. He said that knowing Oracle contracts were more expensive than Red Hat ones.

Anyway, everybody knows that there are many good Application Server options out there (both free and paid ones). So, what do you think? Would you be using the JBoss EAP Alpha in a production environment? Please, leave your comment. I would love to hear it.

7 comentários:

  1. Nice write up.

    I haven't used JBoss for a long time, and it is quite surprising they decided to break backward compatibility for some specific features. I think this can be a show stopper for most teams considering to migrate their apps.

    Also, I couldn't agree more wrt the release name... I wonder what is the rationale behind it.

    I am totally sold to TomEE, but what is your take on Glassfish? I'd think it is a good alternative to JBoss.

    Take care,
    Rafael

    ResponderExcluir
    Respostas
    1. We have been working in a migration from JBoss EAP 4.3 to JBoss EAP 6.x since November. And I would say it is not an easy task. Mainly because JBoss used to be too open and now it is too strict. Hope the next migration would be simpler.

      About the rename. For me it is clear: money. :-)

      I've not used TomEE yet, but I'm just waiting the opportunity. The only fallback I can see is that it is not JavaEE 6 Full Profile. But they have the TomEE+ which adds some must have features, such as JAX-RS and JAX-WS.

      About Glassfish, I haven't used it for a long time, but the issue I see is that I don't recall anyone who uses it in production environments.

      Excluir
  2. Good article, Jboss AS 7 is best example of over engineering. Its moved major pain from some area and replaced with 150%. The people who are maintaining or developing will definitely call it as Jboss ASS 7. TomEE is a better choice but its not a replacement for Glassfish or JBoss AS7

    ResponderExcluir
    Respostas
    1. Hi Nick, I agree that the JBoss redesign is a good and must have move. Manly for those who will start new projects. The problems/difficulties only appear when you start a migration from older versions. Soon I will be posting more about this ;-)

      Excluir
    2. I understand that it was reengineered, but certainly not over-engineered. It was a wise decision to move away from the parent delegation model to achieve better modularization. It not only helped to make the startup time amazingly fast (with low memory footprint), but also opened for us to leverage that on our apps.

      Excluir
  3. Every time I use the well-tested and funded JBoss Developer Studio for all my devops tasks, which is every minute of every working day, including actual working non-breaking docker tooling and Git integration and the RSE which RedHat stubbornly patched the abandoned and broken upstream, I am reminded of how loyal I am to be to JBoss :)

    ResponderExcluir