[ejabberd] AtomPub interface

Eric Cestari eric at ohmforce.com
Fri Jun 20 12:24:59 MSD 2008

Le 20 juin 08 à 08:55, Mickaël Rémond a écrit :
> Le 20 juin 08 à 00:43, Christophe Romain a écrit :
>>> Could I imagine having those 780K subscribed to a pubsub node ?
>> the broadcast_publish_item function needs to get the list of
>> subscribers and process that list to see who is going to be notified.
>> that makes each publish build that list.
>> if you have one node that's ok. but if you have thousands, that
>> probably not gonna work.
> Yes, but a special pubsub plugin could be written to do distribution  
> by batch of a few thousands.

I was thinking along those lines. Especially if you can distribute the  
load over several servers, which I suppose would not be hard to  
implement in ejabberd :)

>> 2. One thing that lacks in XEP 60 to make the bridge better is a way
>> to address a single item in a node.
> i don't know at which level you need that (i didn't looked atompub
> yet), but if you need to access any single item internally from your
> module, you can use node_default:get_item/3 or node_default:set_item/
> 1 in a transaction.

Internally that's no problem.
However, I tried to stick to the mod_pubsub module for the API to have  
the code truly portable over pubsub plugins, and couldn't because of  
two things :

1- Fetching the individual item.
That could be corrected by having a mod_pubsub:get_item/3 delegating  
it to node_*

2- Listing the subnodes of a given node.
Not sure how to implement that with elegance in mod_pubsub. I did that :

	Collections = mnesia:dirty_select(
	       [{#pubsub_node{parentid = {?PUBSUB(Domain), ?ROOTNODE(Domain,  
						nodeid={?PUBSUB(Domain), ?ATOMNODE(Domain, UserNode,'$1')},_ =  

Looks like that the pubsub_node table belongs to mod_pubsub. So one  
could just implement mod_pubsub:get_subnodes(Host, Node, Jid) with the  
previous call.
What do you think ?

To get back to my original question, I was thinking of the XEP itself  
-- which would then be implemented in ejabberd ;)

There is a small impedance mismatch in my opinion between PubSub and  
AtomPub. So small I wish it could be removed !
It boils down to Requesting some items [ http://www.xmpp.org/extensions/xep-0060.html#subscriber-retrieve-requestsome 
One can get the N last items, but one cannot get a single item (unless  
it's the last one).
The following could be implemented :
<iq type='get'
     from='francisco at denmark.lit/barracks'
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <items node='princely_musings'  

One last quick yes/no question about PubSub and ejabberd.
ejabberd considers the nodes as "nodes" in a tree.
However XEP-60, from my understanding, does not make such an  
assumption, and basically considers just a list of nodes.
Is that right ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jabber.ru/pipermail/ejabberd/attachments/20080620/379639f2/attachment.htm 

More information about the ejabberd mailing list