[JDEV] Lots of Presence: Distributed access to presence data from a server farm

Robert Norris rob at cataclysm.cx
Wed Jul 2 20:20:57 CDT 2003


> Soooo... What's the best way to do this?  I like it to work with JabberD
> 1.4.2 but move over to JabberD 2.0 easily.

The concept will be the same, but its likely that some code will need to
be changed.

> 1) Write a Jabber component that queries the Jabber server for presence
> info in real time.  My guess is that this would be a bottleneck in web
> page generation.  Or am I wrong...

And that component would need a subscription to each user that you
wanted to get presence for.

> 2) Write a Jabber component that listens in on <presence> packets and
> keeps a cache in memory.  My JSP bean simply queries the in-memory
> cache.  On cache misses we report "not available" and then request an
> update in the background so our next report is a wee bit more accurate.
> It's OK to be a little bit wrong in my app

jabberd 1.4 has a presence BCC option that you can use with this.
jabberd 2.0 has a <log/> component bind option that does roughly the
same job (though you'd get copies of all packets, not just presence).

Take a look at "msglog" and "bandersnatch" for some code examples.
They're both on jabberstudio.org, IIRC.

> 3) Same as #2, except drop the presence data into a database.  This
> gives us a more scalable approach.

Same again, of course.

> 4) Maybe patch the Jabber server to drop presence information directly
> into a database

Doable via session manager modules. You could just as easily write a
session manager module that makes the session manager query-able for
presence information (which gets around the subscription requirement of
#1).

I'm happy to provide more help once you've decided what you want to do.

Rob.

-- 
Robert Norris                                       GPG: 1024D/FC18E6C2
Email+Jabber: rob at cataclysm.cx                Web: http://cataclysm.cx/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://www.jabber.org/jdev/attachments/20030703/434654e4/attachment-0002.pgp>


More information about the JDev mailing list