[ejabberd] How to queue outgoing stanzas from a webapp

Raoul Duke rduke496 at gmail.com
Fri May 18 22:44:24 MSK 2018


Hi,

I have a (Django) web application in which (based on user events) I want to
queue outgoing event/notification stanzas to XMPP users.

I'm trying to determine the best way to do this.  Options I've considered
are:

1. do a API call to the ejabberd REST API (send_stanza / send message)
based on user action

2. do the above in an async worker (Celery or similar)

3. something else.  e.g. offline store uses postgres (spool table).  Could
I insert outgoing messages into this?  this would be very convenient and
lightweight but how would I ensure those messages were flushed out to users
if they were currently connected to the ejabberd?

4. is there anytihg else like a plugin which sends stanzas based on a DB /
redis queue?

I am currently doing #1 but I'd rather not have any failure to call the API
(e.g. XMPP server is down for maintenence) cause web application users to
experience delays / errors.  #2 is viable but is extra moving parts I'd
rather avoid and still no clear

Any insights appreciated.

Thanks,
RD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20180518/4f5b2939/attachment.html>


More information about the ejabberd mailing list