3 ms·
WebSocket as Message Broker
I was recently thinking that not many officially talk about WebSocket this way. When you have a WebSocket API and you follow some subprotocol like STOMP, your WebSocket basically becomes a message broker where you can subscribe/unsubscribe for certain messages only.
what do you think?
- speedgoose 4y agoYou can indeed implement a very simple message broker with a WebSocket server. I would however use STOMP or MQTT over WebSocket with existing messages brokers so you don't reimplement the wheel. I did reimplement the wheel many years ago and nowadays I prefer to use RabbitMQ or Mosquitto (over WebSocket).
- grebred 4y agoThen WebSocket becomes a broker proxy right?
- speedgoose 4y agoYes, though many brokers can support websocket directly so you can see it as some kind of transport layer and not a proxy as well.
- throwaway0asd 4y agoI am working on a decentralization project and I am dropping HTTP for WS everywhere. WS is faster with far less complexity because there is not a message round trip. Each message is treated as a unique event at each end point.
- deleted 4y ago[deleted]
- fhaldridge7 4y agoHave been doing the same with RabbitMQ+Web-STOMP plugin and it works well. Easy to setup