Mule vs. JXTA - A General Comparison

After reading the title of this article, you might be saying to yourself, "Mule is an ESB and JXTA is a P2P platform.  Apples vs. Oranges"  Yes, both technologies are quite different and intended to solve different issues, but both can be used to solve many of the same issues each other has been designed to take care of.  Network applications are all over it seems yet their use is still increasing in popularity.  This presentation aims to highlight the pros and cons of using JXTA or Mule and contrast them to determine what is the best solution for a distributed network application.  This article aims to highlight the differences and similarities and to gain a better understanding of both.  This article also aims to open a discussion about the idea of Mule (or any ESB) supporting a technology like JXTA to gain its advantages if they are deemed beneficial.

First off, why Mule?  Why not ServiceMix or another ESB?  I chose Mule just because externally Mule and SeviceMix appear to be the same[1] but if ServiceMix does something that Mule cannot do in the scope of this comparison, I encourage anyone to kindly post a reply.

Both Mule and JXTA have overlapping features such as providing a platform to abstract the network from the application, providing communication and services to a group of authorized peers over secure channels and the ability to emulate various network topologies:  p2p, client/server, service buses.  So how are they different?  The most obvious difference is that Mule is a "high-level" technology designed for quick implementation to solve many distributed application problems like having two legacy applications communicate with each other in different data formats or protocols.  JXTA, in comparison, is a "low-level" platform providing a set of its own networking protocols that the developer must implement in concert to communicate to its remote peers.  As you might expect, JXTA has a higher learning curve and has more parts to manage than Mule does, but as you also might expect, JXTA provides finer and more custom control over the network semantics and can reach peers through more firewall and nat configurations than Mule

JXTA is an open source peer-to-peer protocol used to send text/binary messages or streams over unreliable disparate networks to peers belonging to specific groups.  Strictly speaking, JXTA is a set of open xml-based protocols used to create logical networks on top of physical networks.

Mule is an Enterprise Service Bus used to send text/binary/POJOs to one or many endpoints on unreliable disparate networks.

 JXTA – Pros

  • Creates P2P Networks with Peers and PeerGroups

  • Autonomously find peers and resources on the network even across firewalls

  • Create your own groups of peers of devices across different networks

  • Secure communications

  • Exchange messages independent of the network topology

 

 JXTA – Cons

  • Stable release is lacking some performance and convenience enhancements.

  • Nightly release is pretty much needed but some functionality is broken at the moment[2]

  • Some complexity to accomplish tasks

  • Non-transparent API and steeper learning curve

 

 Mule – Pros

  • Easy to Setup, Use and Configure.

  • Can talk to other applications like C and PHP over various network protocols.

  • Passing Business Objects over the network (instead of packets and streams).

  • Abstracts the transportation protocol

  • Can connect 2 endpoints with different output formats together.

 

Mule – Cons

  • Can't do peer discovery

  • Can't do sharing or Advertising of resources

  • Can't communicate through a firewall without  possibly changing the firewall rules on the client side.

 

Both have in common:

  • Polling external peers from behind firewalls to establish a 2-way connection.

  • Documentation is lacking and is still being developed and written.

 

Conclusion:
In a distributed network application, it is necessary to be as independent of client side firewall rules as much as possible.  This is where the 2 technologies differ somewhat.  JXTA can work from behind a very restrictive firewall; the bare minimum would have to at least allow out-bound port 80 but can block all in-coming.  Mule sometimes needs to expose in-coming ports on both client and server side.  If you are distributing your network application  on an internal or private network where you, the developer, has control over the firewall & NAT rules, then Mule would be a good choice, but if your applications will be distributed behind multiple unknown firewall & NAT configurations, then JXTA would be a better choice.

 

 References:

  • [1] http://incubator.apache.org/servicemix/how-does-servicemix-compare-to-mule.html

  • [2] https://jxta-jxse.dev.java.net/issues/show_bug.cgi?id=42