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 spring-websockets and I did some reading about what is the best way to implement it. Then I came across STOMP (as a sub-protocol for websockets)and as there is direct support for STOMP in spring it was bit easy to achieve what I was supposed to do.
But my doubt is as far as my understanding STOMP and XMPP are similar protocols(messaging protocols) but I could not find any questions/blogs where the differences are explained and why somebody would prefer one over another?
It will be really helpful if somebody explains how these two protocols differ?
Thank you.
If you have major concerns about security, then XMPP is the protocol for you. If you require built-in presence and messaging functionality, XMPP is your best choice. If data transmission speed is a top priority, then WebSocket is the protocol you're looking for.
By default, stomp. js will use the Web browser native WebSocket class to create the WebSocket. However it is possible to use other type of WebSockets by using the Stomp.
Whereas in the case of WebSocket, you can not use them alone for chat, instead you can use these WebSockets without XMPP, this means that you have to build chat platform of your own with layer protocols that eventually saves time and excess of associated tasks. However, you would have heard about the OSI model.
WhatsApp uses Ejabberd (XMPP) server which facilitates instant message transfer between two or many users on a real-time basis.
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With