Reader small image

You're reading from  Hands-On Microservices with Django

Product typeBook
Published inMay 2024
PublisherPackt
ISBN-139781835468524
Edition1st Edition
Right arrow
Author (1)
Tieme Woldman
Tieme Woldman
author image
Tieme Woldman

Tieme Woldman works as a freelance Python developer and technical writer. As a Python developer, he builds web and data engineering applications with Django and Python data transformation packages such as pandas. As a technical writer, he has written software and user documentation for software companies such as Instruqt, Noldus Information Technology, and Rulecube. Tieme lives in the Netherlands, has a bachelor's degree in computer science, and holds several (technical) writing certifications.
Read more about Tieme Woldman

Right arrow

Introducing task queues

Producers and workers are independent and need a mechanism for producers to offload tasks to workers and, occasionally, for workers to send back a response to a producer. The microservices architecture uses task queues for this communication. A task queue is what its name implies: a queue where producers place tasks and workers pick up those tasks. In its most basic form, a task queue operates like this:

Figure 6.1 – A basic task queue

Figure 6.1 – A basic task queue

Besides this basic scenario, task queue managers support more complex scenarios such as the following:

  • Work queues, where multiple workers share the tasks
  • Publish-Subscribe, where multiple workers receive and process all tasks
  • Request-Response, where workers send back a response to the producer

Let’s look at how these scenarios work, including code examples based on the pika package for the producers and workers and with RabbitMQ as the task queue manager. We&...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Microservices with Django
Published in: May 2024Publisher: PacktISBN-13: 9781835468524

Author (1)

author image
Tieme Woldman

Tieme Woldman works as a freelance Python developer and technical writer. As a Python developer, he builds web and data engineering applications with Django and Python data transformation packages such as pandas. As a technical writer, he has written software and user documentation for software companies such as Instruqt, Noldus Information Technology, and Rulecube. Tieme lives in the Netherlands, has a bachelor's degree in computer science, and holds several (technical) writing certifications.
Read more about Tieme Woldman