[JDEV] multiple <iq/> requests and message order

Sebastiaan 'CBAS' Deckers cbas at screaming3d.com
Tue Feb 4 11:20:39 CST 2003

You're supposed to use the id attribute of the <iq/> element, not 
necessarily for <message/>.

SENT: <iq id="abc123" to="foo at bar" type="get"/>
SENT: <iq id="def456" to="foo at bar" type="get"/>
RECV: <iq id="def456" from="foo at bar" type="result"/>
RECV: <iq id="abc123" from="foo at bar" type="result"/>

This is documented here:

The optional 'id' attribute MAY be used to track stanzas sent and 
received. The 'id' attribute is generated by the sender. An 'id' 
attribute included in an IQ request of type "get" or "set" SHOULD be 
returned to the sender in any IQ response of type "result" or "error" 
generated by the recipient of the request. A recipient of a message or 
presence stanza MAY return that 'id' in any replies, but is NOT REQUIRED 
to do so.

The value of the 'id' attribute is not intended to be unique -- 
globally, within a domain, or within a stream. It is generated by a 
sender only for internal tracking of information within the sending 


Fabio Forno wrote:
> Reading the various specification I can't understand whether a client 
> can issue an <iq/> packet for another node, and then send other <iq/> 
> packets to the same node before receiving any answer.
> My second question regards message order. Some time ago I've done some 
> tests sending several straight packets of type <message/> from a node to 
> another. With my surprise I've discovered that the arriving order was 
> rather random. Is this behavior documented somewhere, or it may depend 
> on server implementations?
> Thanks for your help.

More information about the JDev mailing list