[standards-jig] NEW: Publish-Subscribe (JEP-0060)

Alexey Shchepin alexey at sevcom.net
Thu Dec 12 19:27:17 UTC 2002


Hello, Peter!

On Wed, 11 Dec 2002 22:25:19 -0600 (CST), you said:

 PS> Peter Millard has released a new JEP for publish-subscribe:
 PS> http://www.jabber.org/jeps/jep-0060.html

Great :)  But few comments:

In section "5.1.3 Subscribe and Unsubscribe to a node":

  Example 13. Entity subscribes to a node

  <iq type="set" from="sub1 at foo.com/home" to="pubsub.jabber.org" id="sub1">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
      <subscribe node="generic/pgm-mp3-player"/>
    </pubsub>
  </iq>
  
  Example 14. Server replies with success
  
  <iq type="result" from="pubsub.jabber.org" to="sub1 at foo.com/home" id="sub1">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
      <entity jid="sub1 at foo.com" affiliation="subscriber"/>
    </pubsub>
  </iq>

What rules are used to get value for "jid" attribute in reply?  As I see from
example, pub/sub service removes resource, but is this good if we want to allow
subscription for any jabber entity?  Maybe allow subscriber to define what jid
he want to be subscribed, e.g.

  <iq type="set" from="sub1 at foo.com/home" to="pubsub.jabber.org" id="sub1">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
      <subscribe jid="sub1 at foo.com" node="generic/pgm-mp3-player"/>
    </pubsub>
  </iq>
  
  <iq type="result" from="pubsub.jabber.org" to="sub1 at foo.com/home" id="sub1"/>

Also we can use something like in mailing lists: service send key to potential
subscriber, and he must return it back to subscribe.  This also allows to do
something like "invitations":

  man at foo.com/home want to subscribe sub1 at foo.com to node:
  <iq type="set" from="man at foo.com/home" to="pubsub.jabber.org" id="sub1">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
      <subscribe jid="sub1 at foo.com" node="generic/pgm-mp3-player"/>
    </pubsub>
  </iq> <!-- maybe here better use <message/> like below -->

  Service send to sub1 subscribe message:
  <message from="pubsub.jabber.org" to="sub1 at foo.com" id="sub1">
    <body>man at foo.com/home 
    <x xmlns="http://jabber.org/protocol/pubsub">
      <subscribe jid="sub1 at foo.com"
                 from="man at foo.com"
                 node="generic/pgm-mp3-player">
        ...KEY...
      </subscribe>
    </x>
  </iq>

  sub1 subscribes:
  <iq type="set" from="sub1 at foo.com/home" to="pubsub.jabber.org" id="sub1">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
      <subscribe jid="sub1 at foo.com" node="generic/pgm-mp3-player">
        ...KEY...
      </subscribe>
    </pubsub>
  </iq>

  <iq type="result" from="pubsub.jabber.org" to="sub1 at foo.com/home" id="sub1"/>


Also, I think that in implementations allowing for all users to write in the
same namespace can make conflicts, so likely will have full access only to it's
own namespace, e.g. "users/<username>/" (yes, this is more implementation
issue, but IMHO beter to mention this at least as recomendation to avoid
"users/someone", "|home|someone", etc from different servers).

PS: Also this is a good example of using modified disco :)



More information about the Standards mailing list