Read 19 ~ Message Queues
By Abdallah obaid
NAME | URL |
---|---|
Home | Home. |
Prep | Prep: Engineering Topics. |
Read 01 | Node Ecosystem, TDD, CI/CD. |
Read 02 | Classes, Inheritance, Functional. |
Read 03 | Data Modeling & NoSQL Databases. |
Read 04 | Advanced Mongo/Mongoose. |
Read 05 | Linked Lists. |
Read 06 | HTTP and REST. |
Read 07 | Express. |
Read 08 | Express Routing & Connected API. |
Read 09 | API Server. |
Read 10 | Stacks and Queues. |
Read 11 | Authentication. |
Read 12 | OAuth. |
Read 13 | Bearer Authorization. |
Read 14 | Access Control (ACL). |
Read 15 | Trees. |
Read 16 | Event Driven Applications. |
Read 17 | TCP Servers. |
Read 18 | Socket.io. |
Read 19 | Message Queues. |
Message Queues
## Message Queues:
- We use it to routing events and messaging between clients.
- A Message Queue is a form of asynchronous service-to-service communication used in serverless and microservices architectures. Messages are stored on the queue until they are processed and deleted. Each message is processed only once, by a single consumer.
- Queue server receive any published message and then distributing it out to all connected and subscribed clients.
- Queue server must catch the subscribed messages so the client can return it back when needed.
## Real Time vs Queued Messaging:
- In Real Time messaging systems If the subscriber client loses connection with the server, any messages broadcast by the server will clearly be missed by the client.
- Queue will keep track of the delivery status of every event/message.
- Any broadcast that is not received by a subscriber will remain “in the queue” until it can be delivered
- Rather than a broadcasting of messages, clients will likely pollthe server to retrieve any messages “in the queue” for them, on their own timeline/schedule.