Jamie's Blog

Lessons from a life of startups, coding, countryside, and kids

Jabber vs JXTA: Take II

Today, I was googling away for Jabber and J2ME stuff when I came across a post by Bill de h?ra in response to my post last month, JXTA or Jabber?. I’d missed this completely. And the follow-up post. So now I google again for JXTA Jabber and find some more pieces which weren’t there last month. Cool.

So do I have anything to add? I like Jabber. I’ve read the spec, a couple of articles and used the IM clients (and snooped on them a bit too) and I’m beginning to think it’s quite a nice protocol. JXTA is much more complicated than Jabber but it’s also younger and obviously lacks the protocol and community maturity.

Recently, Diego wrote a one-minute intro to JXTA (but allow 2mins!) which captures the main ideas. The problems with JXTA occur when a) you try to understand each protocol in further detail, b) you try to use the example applications, c) you try to read the source code and d) when you try to write your own application. This is not encouraging. One problem which causes me major headaches is the source distributions of jxta are all cvs checkouts instead of exports. This means there are tons of empty or half-empty, abandoned directories which you have to sort through to findthe “real” sourcecode. nuts!

In some cases I believe the choice between JXTA and Jabber should be obvious. Does anyone use Jabber to connect devices over IrDA or Bluetooth? No. Could you use JXTA? Well, maybe/probably - it would certainly be better. But as soon as your application moves away from a pure P2P architecture (i.e., some peers become more important than others) and it has access to the Internet, Jabber becomes a better looking alternative. After all, what is the difference between JXTA rendezvous’ and Jabber servers?

The key thing JXTA can do which Jabber can’t, is Discovery (Jabber browsing and any other Jabber discovery specs aren’t really up to the task as far as I can see). But then Jabber has presence information, permanent user addresses and the facilities to handle 1 user, multiple devices, all of which would have to be built on top of JXTA.

So my current thinking is:
Use JXTA for…

  • discovery things
  • connecting together devices
  • ad-hoc and short-range group structures
But use Jabber when…
  • your application relies on an internet connection anyway
  • your users will appreciate an address familar to them e.g., hopeless@jabber.org
  • your application is similar to email, IM, etc
  • Presence information could be useful
And remember this is all in the context of J2ME devices; the rules are different elsewhere.

I’m leaning towards Jabber for my application. “Now where’s the open source, commercially-exploitable J2ME Jabber library?Damn!, I guess would be my first job.