[jdev] Pubsub items' timestamps
Stephan Maka
stephan at spaceboyz.net
Thu Apr 14 14:04:09 UTC 2011
Peter Saint-Andre wrote:
> On 11/22/10 9:11 PM, Sergey Dobrov wrote:
> > Why there is no way to retrieve a timestamp where an item was published?
> > Why there are no possibility to retrieve an items that newer (or older)
> > that specified timestamp?
> We've had other requests for at least the "retrieve since" feature. The
> best way to do that might be to do presence-based notifications and
> include the last logout time in initial presence.
We were confronted with the same problem at buddycloud and putting
timestamps in presence gave us some headaches:
<presence/> is cached on the server side and can be resent to a service
coming online and probing for presence, resulting in potentially
unneccesary history pushes. An entity interested in just history may not
be required to send presence, because that also includes notification
<message/> stanzas. From a bird's eye view requesting history is a
pretty use case for <iq/> RPC semantics.
Also problematic with a one-shot approach: if there had been a network
partition in effect when the user logged out, the missing items won't be
included in history. Another pretty obvious problem with using single
timestamps on a global base is clock skew in the heterogenous XMPP
network.
The approach we agreed upon is based on the knowledge of all user
subscriptions at a user's home pubsub service: it knows about the "last
synchronization time" per service or node, and will recurse the history
request to all remote service with that particular information. The
incentive for that mechanism was saving on round-trips for mobile
clients that are interested in synchronizing with multiple pubsub
services.
Stephan
More information about the JDev
mailing list