Introducing STOMP Protocol
Understand the benefits of STOMP over raw WebSockets for structured message routing and subscription.
Meet STOMP: Structured Messaging
Welcome to STOMP! When building real-time apps with WebSockets, you often need more than just raw data transfer. You need structure, routing, and a way to subscribe to specific messages.
STOMP (Simple Text Oriented Messaging Protocol) provides this structure. Think of it as a higher-level protocol that sits on top of WebSockets.
Raw WebSockets: Limitations
With raw WebSockets, clients and servers send arbitrary bytes or strings. If you want to send a "chat message" or a "user joined" event, you have to define your own rules:
- How do I know what kind of message it is?
- Who should receive this message?
- What if I want to send data in a specific format like JSON?
Without a protocol, you'd implement all this manually.