[JDEV] pubsub (JEP-0060) implementation

Greg Hewgill greg at hewgill.com
Sun Dec 29 20:58:43 CST 2002


I've been working on an implementation of Publish-Subscribe as proposed in
JEP-0060. I posted over on the standards-jig list a number of questions and
comments about the proposal itself. This post is just to let interested parties
know what I'm working on.

My implementation is written in Perl with Net::Jabber. The implementation is
split into three parts:

1. The front-end, which is the interaction with Net::Jabber - interpreting
requests, constructing responses, and so on.

2. The protocol implementation, which is called by the front-end and codifies
the rules of pubsub. For example, this ensures that only publishers may
publish, only owners may delete, and determines who may subscribe to a node.

3. The back-end, which stores information about nodes, items, entities, and the
relationships between them.

This separation makes it easy to replace individual components as desired. For
example, I have a back-end that uses the Perl DBI to talk to PostgreSQL (I
suppose MySQL would work equally well, for those so inclined), and another
back-end that uses native Perl data structures (but does not even attempt
persistence if the component is stopped and restarted). Another back-end that
would be useful would be a filesystem one, with a directory tree holding nodes
and files holding subscription information and persistent items.

It should also be straightforward to port this implementation to another
interface library such as JabberBeans, as the Net::Jabber specific code is
well-contained.

Anyway, there is an instance of this component running at
"pubsub.jabber.hewgill.net". This is my development instance, so the usual
caveats apply (ie. it may or may not be running at any given moment, and if it
is, it may or may not work :). Anybody can create nodes and subscribe/
unsubscribe, but some owner use case things are not yet implemented (ie.
configuring a node). Experimentation is encouraged and feedback is welcome!

Greg Hewgill
http://www.hewgill.com



More information about the JDev mailing list