Skip to content

Pub-Sub (Publish-Subscribe)

Publish-subscribe (pub-sub) is a messaging pattern where publishers emit events to a central broker without knowing who will receive them, and subscribers register interest in specific event types and receive matching events asynchronously.

Understanding Pub-Sub (Publish-Subscribe)

Pub-sub decouples the sender of a message (publisher) from its receivers (subscribers). Publishers emit events without knowing or caring which subscribers are interested. Subscribers register for event types they care about and receive relevant events without needing to poll or maintain direct connections to publishers. This decoupling makes systems easier to extend: adding a new subscriber to handle a new use case requires no changes to publishers or existing subscribers. Message brokers like RabbitMQ, Apache Kafka, and Google Cloud Pub/Sub implement this pattern at scale.

How GAIA Uses Pub-Sub (Publish-Subscribe)

GAIA uses pub-sub messaging through RabbitMQ to coordinate its agent workflows. When an email arrives, the email intake service publishes an event to the broker.

Related Concepts

Frequently Asked Questions

An API call is direct and synchronous — one service calls another and waits. Pub-sub is indirect and asynchronous — the publisher emits an event and any number of subscribers receive it when ready. Pub-sub scales better and is more resilient to individual subscriber failures.

Explore More

Stop doing everything yourself

Join thousands of professionals who gave their grunt work to GAIA.