liveBook · Manning

Anonymous queue

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A RabbitMQ queue created without a specified name so the broker generates a unique queue name for one consumer.

An anonymous queue lets one microservice receive its own copy of broadcast notifications without choosing or coordinating a queue name. RabbitMQ generates a unique name, while the shared exchange routes messages to each consumer’s private queue. section 5.8.7

Configure an anonymous queue by:

  • Asserting the shared Viewed exchange as a fanout exchange. section 5.8.7

Receiving Viewed notifications

A history microservice creates its exclusive anonymous queue, binds it to the Viewed exchange, consumes each notification, stores the video path, and acknowledges the message. A recommendations microservice can independently use its own anonymous queue. section 5.8.7

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains generated names, exclusive ownership, exchange binding, consumption, persistence, and acknowledgement.
Examples
Uses Viewed notifications consumed by history and recommendations microservices.
What it assumes
Assumes RabbitMQ channels and JSON messages while demonstrating exchange assertion, queue creation, binding, and acknowledgement.
What you can do after
Operate RabbitMQ consumers that receive private copies of fanout notifications.
How it connects
Connects anonymous queues to RabbitMQ exchanges, fanout routing, message binding, consumers, and microservices.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.