[jdev] Add a timestamp and/or ID to message stanzas

Kurt Zeilenga Kurt.Zeilenga at Isode.com
Fri Sep 11 15:04:14 CDT 2009


On Sep 11, 2009, at 6:45 AM, John Stewart wrote:

> I need to add either a guaranteed unique timestamp, or a timestamp  
> plus a guaranteed unique ID to EVERY message stanza passing through  
> an XMPP server. The timestamp will be displayed in customized  
> clients, and the timestamp or ID, will be used to store and retrieve  
> messages from a database.
>
> I've done quite a bit of searching, and so far in the XMPP docs,  
> I've only seen references to message IDs as optional, and timestamps  
> as being used for delayed delivery. So I think I'll be developing a  
> custom extension, in a non-standard namespace.
>
> Questions:
> 1. Have I overlooked an already existing spec for what I need to do?
> 2. Can I add this functionality using an external XMPP component 
> (XEP-0114), or will I have to write a mod for a specific XMPP server 
> (ejabberd most likely)?
> 3. Is it easy/possible to create a guaranteed unique timestamps in  
> an ejabberd component?

I'm aware of two timestamp approaches for XMPP.

The first is in "Stanza Headers and Internet Metadata" [XEP-0131].

     <headers xmlns='http://jabber.org/protocol/shim'>
       <header name='Created'>2004-09-21T03:01:52Z</header>
     </headers>

The second is from the CDCIE chat protocol (http://www.jfcom.mil/about/fact_cdcie.html 
).  It's of the form:
     <x xmlns='jabber:x:tstamp' tstamp="CCYY-MM-DDThh:mm:ss.sssZ/>

For example:
     <x xmlns='jabber:x:tstamp' tstamp="2008-03-10T12:43:18.002Z/>

I favor the former as its Standards Track.

-- Kurt





More information about the JDev mailing list