esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.64k stars 422 forks source link

How does mongooseim handle unacknowledged stanza's ? #4210

Closed alvinlal closed 4 months ago

alvinlal commented 4 months ago

MongooseIM version: 6.1.1 Installed from: pkg Erlang/OTP version: 26

i have enabled mod_stream_management in my mongooseim server and the server is requesting for acknowledgment for every stanza send from server to client using the <r xmlns="urn:xmpp:sm:3" /> element. I am keeping the count of the h value in client and sending <a h="current value of h in client" xmlns="urn:xmpp:sm:3" /> for every ack request from the server. I want to know what happens if i don't send the ack (<a /> tag) for every ack request (<r/> tag) from the server . Does mongooseim store those unacknowledged stanza's in an offline queue and resend them on the next client connection ?

DenysGonchar commented 4 months ago

here is a quote from XEP-198:

A server SHOULD treat unacknowledged stanzas in the same way that it would treat a stanza sent to an unavailable resource, by either returning an error to the sender, delivery to an alternate resource, or committing the stanza to offline storage. (Note that servers SHOULD add a delay element with the original (failed) delivery timestamp, as per [Delayed Delivery (XEP-0203)](https://xmpp.org/extensions/xep-0203.html) [[10](https://xmpp.org/extensions/xep-0198.html#nt-idm46207184266816)]).

MongooseIM follows this recommendation (if mod_offline is configured). However, we highly discourage mod_offline and recommend mod_mam for dealing with offline messages.

alvinlal commented 4 months ago

@DenysGonchar got it , thanks for the clarification 👍