sokc
sokc

Reputation: 51

How does ejabberd handle message ordering and delivery?

As per https://datatracker.ietf.org/doc/rfc6120/?include_text=1 and 10.1. In-Order Processing How is Ordered Message Delivery ensured across all items in roster?

  1. Is it done at server or client side? If it is on any side, are newer messages being waited upon older messages with a timeout?
  2. Does it use an incremental sequence number for ordering guarantees?
  3. On client re-connect, how does client know what to pull from server? Does the client send last msgIds of all items in roster? or does Server keep the QOS data and client state for each device ?

Upvotes: 3

Views: 584

Answers (1)

First of all, As XMPP uses TCP transport protocol it ensures the server receives the data in the same order the client sends it.

As per TCP docs:

TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent

ejabbred is an XMPP server, the raw data received over the TCP must be compliant with the XMPP protocol and the same being verified XMPP server.

In XMPP protocol client can able to send messages after it has done with session initiation, resource bind, and authentication, etc..

These messages are being processed in the order the client sends it and routes to its recipients. If recipients are offline it push and pop to database the same order for later delivery.

Here ordering guarantees mostly ensure by the TCP network stack.

Upvotes: 1

Related Questions