How can I send a large message over XMPP server stanza limit? Any message recommended split method or template?

100 views
Skip to first unread message

EricYang

unread,
Mar 3, 2017, 3:14:11 AM3/3/17
to libstrophe
Hi all,

I met a problem about sending large XMPP message.

When the size of message is over the limitation of XMPP server, the client will be kicked.

Is any recommended way to split the large XMPP message or any recommend XMPP split message format I could follow?

Thanks a lot.


Dmitry Podgorny

unread,
Mar 3, 2017, 7:04:21 AM3/3/17
to libstrophe
Hello,

I haven't found any best-practice for this case. But if you need to send message in any way you can split its body into several messages and send them within independent stanzas. Remember that stanza limit counts from the first '<' to the last '>'. Also there is no particular stanza limit in the standard. Only recommendation that it shouldn't be less than 10000 bytes (see https://tools.ietf.org/html/rfc6120#section-13.12).

I found a project where authors resolved this issue by simple splitting of a message: https://github.com/errbotio/errbot/commit/42457c42b3a4221721d1122b1416a67f3b90f5d2 .

Matthew Wild

unread,
Mar 3, 2017, 7:47:30 AM3/3/17
to libst...@googlegroups.com
On 3 March 2017 at 08:14, EricYang <shun...@gmail.com> wrote:
> Hi all,
>
> I met a problem about sending large XMPP message.
>
> When the size of message is over the limitation of XMPP server, the client
> will be kicked.

What are you sending? XMPP isn't really designed for handling large
amounts of data, and 10KB is fairly generous.

If you're trying to send large amounts of data/files, you can use
https://xmpp.org/extensions/xep-0047.html to transfer it.
Alternatively there are other file transfer mechanisms where the file
data doesn't go over XMPP, which is preferable for larger things like
images and videos, etc.

Regards,
Matthew
Reply all
Reply to author
Forward
0 new messages