Pull/queue messaging
The pull pattern is an excellent design where you may have a worker process running, for example, resizing images. The API would receive the request and then add this to a queue for background processing. The worker process or processes read from the queue, retrieve the messages one by one, perform the required work, and then delete the message from the queue. Often, there is also a queue commonly called a dead letter queue. Should the worker process fail for any reason, then the message would be added to the dead letter queue. The dead letter queue allows the messages to be re-processed in the case of an incremental failure or for debugging purposes. Let's take a look at the following diagram, which summarizes the whole ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access