STOMP or XMPP - Over websocket

前端 未结 1 1356
悲哀的现实
悲哀的现实 2021-02-18 18:23

I am working on a project which involves real time chat (messaging, including group chats).

I have worked with websockets before, So I started working on this using spri

相关标签:
1条回答
  • 2021-02-18 19:15

    As the successor of Jabber, XMPP is more focused on instant messaging instead of STOMP. XMPP is an extensible protocol and could be used for other purposes, but there are plenty of built-in mechanism and implementations regarding IM. STOMP offers a more general mechanism and "message" here refers a broad meaning.

    Let's say you choose STOMP for your project. Then you will probably need to define basic messages for certain scenarios (peer-to-peer, group chat) which are already offered by XMPP.

    To compare two protocols;

    • STOMP message is carried as plain text (as its name indicates) whereas XMPP is structured as XML.
    • STOMP connections can be established via TCP or WebSockets. XMPP supports TCP or HTTP (WebSocket standard is also propopsed).
    • In Java world, Spring has the ability to talk STOMP and it's very easy to implement. However, XMPP support can be added by adding 3rd Party APIs (i.e. Smack)
    0 讨论(0)
提交回复
热议问题