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 ...

Get Building Microservices with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.