REST APIs are synchronous and follow a client-server model (point-to-point).
Async API: put message in a third party (queue) and move on (โfire and forgetโ)
Not only data messages, but tasks messages can be put in queues too.
Event-driven Architecture: put a task in the queue, send it to services and trigger processing in them
Streaming Data Pipelines: huge volume of data (~100K requests/sec) can be sent between services
Simple MQ - single FIFO pipeline. Ex - IBM WebSphere MQ, Rabbit MQ, Apache Active MQ, etc.
Messages in MQs can be ordered (FIFO order) or unordered (high priority ones are processed first).
The message deletion can be turned off in most MQ platforms but the general idea of MQ is remove-on-consume.
Disadvantages:
Publisher puts messages in a central system, subscriber(s) consume them. Broadcasting. Acts as a Distributed Commit Log.
Disadvantages:
Push is good when we have too many producers.
Push is good when we want producers to send data asap.
Pull is good when we want consumers to control the rate of consumption.
The consumer can make request to the broker (pull) with very little additional configurations and firewall issues, than the broker calling a bunch of consumers (push).