Preventing message loss when a user loses data connection to ejabberd

I came across an erlang module which suits my design. The description says:

"This module will send a confirmation/acknowledgement message to your sender when your message has been received by the ejabberd server and another confirmation/acknowledgement message when your message has been received by the recipient of the message."

The module is hosted here:

https://github.com/Mingism/ejabberd-stanza-ack/blob/master/mod_stanza_ac...

However, i havent been able to make this work for ejabberd 14.07 ver. It was configured just fine in the yml as:

mod_stanza_ack:
     hosts: myhost

Removed the INFO_MSG statements too and the logger.hrl is already included.

What could be wrong?

Any other alternative approach to this design is welcome as a suggestion. I know mod_ping is a solution but their would always be an interval which might lead to loss of messages.

Thanks!

I feel that XEP-0198 Stream

I feel that XEP-0198 Stream management support would fit that need already, no ?

Firstly, I think that module

Firstly, I think that module is incomplete. This line in particular looks problematic:
RegisterFromJid = <<"sys@blabbling_dev">>, %used in ack stanza
Is "blabbling_dev" your hostname? If not, this is my best guess as to what the problem is. But you haven't stated what happens when you try to use this module.

Secondly, I've got an alternative you could consider.

I'm assuming you have control over the client. You could mod_archive or make something more specific for your purposes to make the server archive messages and allow clients to request archived messages with an IQ request. XEP-0136 specifies a standard, which mod_archive follows mostly, that could work for you, but IMO it's overkill for your purposes. Basically, the client after login says something like "give me all messages sent to/from me after 06/27/2015 14:51:47.0001," then the server sends those messages to the client packed into an IQ response (see http://xmpp.org/extensions/xep-0136.html#manage-retrieve). That way, any messages lost due to client logout will be saved and could be retrieved, AND the client would know if the server didn't receive any messages that it sent last time it was logged in. If you were to make your own module, you could make the server send the actual message packets when requested instead of packing them into an IQ, if you wish.

Also, it would make multi-device support much better. One flaw of Ejabberd (with default setup) is that it doesn't work too well if a user has both a phone and a PC. Messages will never be delivered to one device if the other receives them, and behavior while logged in on two devices at once with the same priority undefined in the XMPP standard (but Ejabberd currently delivers the messages to all of them). So if this matters to you, and you want to solve two problems at once, archiving messages is a good choice.

Well, ejabberd follows the

Well, ejabberd follows the XMPP specifications. There is specifications for multi devices that ejabberd supports, but you you need a modern client that takes advantage of it.

Hi, sys@blabbling_dev is not

Hi,
sys@blabbling_dev is not my hostname.
I changed that to success@hostname. I could make the module work with a little binarization tweak as well.

But in my design i'd not be able to use this mod_sys_ack module. The reason being the kind of requests which initiate the mesasges. My design is like this:

User A initiates a message (By an HTTP request and not XMPP) in a group --> message sent as HTTP data to the server --> Server forwards it to the users (as XMPP mesasges of the multicast module mod_multicast) in the group.

The mod_stanza_ack seems to be generating no logs for the HTTP requests i am initiating; not even for the acknowledgement which the recipient should send to the server (which would be XMPP).

I guess this can't be put to use. Ideas?

Syndicate content