CloudServices/Notifications/Meetings/Research

From MozillaWiki
Jump to navigation Jump to search

XMPP over Bosh

Overview

    • each http body contains a <body/> wrapper
    • requests sent over a single persistent http connection using http pipelining in order to maximize throughput
    • can't use Chunked Transfer Coding due to potential buffering issues
    • clients include can HTTP Accept-Encoding header and in that case, the Connection manager will include the HTTP Content-Encoding header and compress the body accordingly.
    • make use of HTTP connection sharing at the risk of having packets from different session then the current one, slightly delayed.


<body/> wrapper

    • qualified by 'http://jabber.org/protocol/httpbind' namespace
    • cannot contain: Partial XML elements, XML comments, XML processing instructions, Internal or external DTD subsets, Internal or external entity references

Initiating a BOSH Session

  1. . Session Creation


     POST /webclient HTTP/1.1
     Host: httpcm.example.com
     Accept-Encoding: gzip, deflate
     Content-Type: text/xml; charset=utf-8
     Content-Length: 104

<body content='text/xml; charset=utf-8'

     from='user@example.com'
     hold='1'
     rid='1573741820'
     to='example.com'
     route='xmpp:example.com:9999'
     ver='1.6'
     wait='60'
     ack='1'
     xml:lang='en'
     xmlns='http://jabber.org/protocol/httpbind'/>


  • Parameters
    • Wait - longest amount of time where the connection manager allowed to wait before responding.
    • Hold - number of requests to keep waiting at any given time.
    • POLLING IS NOT RECOMMENDED AS IT WILL RESULT IN LOW THROUGHPUT
    • may need to also include a 'route' parameter if the session is across multiple severs
    • from attribute can also be included if this information is meaningful
    • the ack parameter is also optional and if included, ack will become meaningful.

AMQP

Some others that I came across along the way.

Jabber Long Polling


Perlbal