Project

General

Profile

Extended Stanza Addressing - XEP-0033

Jan Raska
Added almost 5 years ago

Hi, I'm wondering if Tigase support XEP-0033. I'm using XMPP with Tigase in a bit unorthodox way, I use it as message broker for my iOS/Android app and send "push updates" to phones this way, as to overcome limitations of classical push notifications (message body is JSON). And when some actions happen, same message needs to be send to thousands of users, however these recipients are always different, there is no predictable way of saying "this type of message is received by this group of users", and for privacy reasons I can't allow message being received by device of user who should not receive it (for strict privacy reasons I can even to something like receiving message and discarding it on that phone), thus using pub-sub (xep-0060) is not on option for me.

Problem I have is, that when I use Smack library from backend, it takes ca 10ms to send msg to one user and client is blocked during that time, so if I send same msg to 1000 users, it takes 10 seconds to deliver it to everyone, if I send it to 10k users, it takes 100 secs... These events are sometimes happening very often, and thus causing quite big delays in push updates delivery. It's clear to me that XEP-0033 would help me solve that issue, as I'd be sending only 1 msg no matter what is number of recipients, however when I tried, I get error that this feature is not implemented.

Any advice is greatly appreciated. Thanks.


Replies (1)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

Indeed, XEP-0033 is not yet implemented. You have following possible workarounds:

  1. I think the 10 seconds it takes for your client to send a single message is because the client has to login to the server (stream open, TLS handshaking, authentication, etc....). So it would considerably speed it up if your client kept a connection open all the time and sent many messages on a single connection. Then sending each message would take only a fraction of second.

  2. You could use admin interface: XEP-0133 (available either through XMPP or through REST API). Our admin interface allows you to plug own admin commands written in a scripting language. Such a custom command could accept your message body and a list of recipients. So this would be a kind of XEP-0033 implemented on top of admin interface. There are commands already to send a message to all online users, please use it as a code example for your custom command.

  3. You could have a custom Tigase component which can work inside Tigase server and can have a complex logic to send messages to a correct list of users. This is probably the most optimal from performance point of view solution but it also needs most effort.

    (1-1/1)