%ents; ]>
Pub-Sub Subscriptions A proposal for the subscribe half of a publish-subscribe protocol within Jabber. &LEGALNOTICE; 0036 Retracted Standards Track Standards None JEP-0060 None Peter Millard pgmillard@jabber.org pgmillard@jabber.org Peter Saint-Andre stpeter@jabber.org stpeter@jabber.org 0.2 2003-04-22 psa At the request of the authors, the status of this JEP has been changed to Retracted since it has been superseded by JEP-0060. This JEP will not be considered further by the Jabber Software Foundation and should not be used as a basis for implementations. 0.1 2002-07-12 psa Initial version based on discussions at JabberConf.

The Jabber community needs a cohesive standard for publish-subscribe functionality. Certainly there is interest in developing such a standard, as witness the number of JEPs written on this topic. JEP-0021, JEP-0024, JEP-0028. Unfortunately, past discussion of this issue has been clouded by confusion over requirements and even terminology. This JEP seeks to clarify the situation somewhat and to provide a protocol for the subscribe half of publish-subscribe functionality within Jabber.

Traditional pub-sub consists of event notification. This makes it possible for entities to publish data and for other interested entities to receive notification when the data is published. The following are some likely applications of pub-sub functionality within Jabber:

In such systems, a subscriber would request to receive notifications about data the subscriber is interested in. We define a "topic" as an object that defines the relationship between a publisher and its subscribers. Specifically, a topic contains three essential collections of information:

  1. A description of the information that will be provided
  2. A list of subscribers to items that fit the description
  3. One or more items that fit the description

We define an "item" as an instance of data published by the publisher that fits the description associated with a topic. Each item MAY possess a unique identifier that enables the data to be tracked. (NOTE: This JEP does not address the durability of items, i.e., data storage.)

A topic is addressed by means of a unique "topic ID". A topic ID is simply a string with no required semantic meaning. While a topic ID may have semantic meaning (e.g., '/instruments/guitars/electric' or 'rec.music.dylan'), such meaning is not necessary and a topic ID may be any random string (e.g., 'a1gh83jfn342092'). The only requirement is that a topic ID be unique within the context of a specific pub-sub domain (e.g., pubsub.jabber.org).

<iq type="set" from="pgm@jabber.org" to="pubsub.jabber.org" id="1"> <query xmlns="jabber:iq:pubsub"> <subscribe> <topic id="12345"/> <topic id="/presence/dizzyd@jabber.org"/> </subscribe> </query> </iq> <iq type="set" from="pgm@jabber.org" to="pubsub.jabber.org" id="1"> <query xmlns="jabber:iq:pubsub"> <unsubscribe> <topic id="12345"/> </unsubscribe> </query> </iq> <iq type="set" to="pubsub.jabber.org" id="1"> <query xmlns="jabber:iq:pubsub"> <publish> <topic id="12345"> <item>some kind of cdata goes here</item> </topic> </publish> </query> </iq> <iq type="set" to="pubsub.jabber.org" id="1"> <query xmlns="jabber:iq:pubsub"> <createtopic> <topic id="new_topic"> <profile> <!-- is this even remotely close?? --> <publisher>pgm@jabber.org</publisher> <publisher>dizzyd@jabber.org</publisher> </profile> </topic> <topic id="another_topic> <profile> <publisher/> </profile> </topic> </createtopic> </query> </iq> <iq type="set" to="pubsub.jabber.org" id="1"> <query xmlns="jabber:iq:pubsub"> <removetopic> <topic id="12345"/> </removetopic> </query> </iq>