0Pricing
RabbitMQ Messaging & Async Systems · Aula

Exchanges, filas e vinculações explicados

Aprenda os principais blocos de roteamento do RabbitMQ — exchanges, filas e vinculações — e como as mensagens fluem dos produtores aos consumidores.

Exchanges, filas e vinculações explicados é uma aula grátis de RabbitMQ Messaging & Async Systems no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de RabbitMQ Messaging & Async Systems, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de RabbitMQ Messaging & Async Systems inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

The Routing Trio

Producers don't publish to queues directly. Three pieces route a message: an exchange receives it, a binding links it, and a queue stores it.

What Is an Exchange?

An exchange is the entry point. A producer publishes to it, and the exchange decides which queues should get the message based on its rules.

What Is a Binding?

A binding is the rule connecting an exchange to a queue, usually with a routing key or pattern that decides whether a message matches.

Direct Exchange

A direct exchange routes to queues whose binding key exactly matches the message's routing key — ideal for point-to-point routing.

channel.exchangeDeclare('logs_direct', 'direct');
channel.queueBind('errors', 'logs_direct', 'error');

Fanout Exchange

A fanout exchange ignores routing keys and broadcasts every message to all bound queues. Perfect for pub/sub where everyone needs everything.

Topic Exchange

A topic exchange routes by wildcard pattern: * matches one word, # matches many. So order.* catches order.created and order.shipped.

Headers Exchange

A headers exchange routes on message header attributes instead of a routing key — the most flexible type, and the least used.

The Default Exchange

The nameless default exchange binds every queue by its own name. Publish with a routing key equal to a queue name and it lands there directly.

Declaring a Queue

Declare a queue before using it, and mark it durable so it survives a broker restart. The code does exactly that.

channel.queueDeclare('tasks', true, false, false, null);

Putting the Flow Together

The full flow: a producer publishes to an exchange with a routing key, bindings match, the right queues store it, and consumers read.

Choosing an Exchange Type

Picking an exchange type: exact key → direct, broadcast → fanout, pattern → topic, header rules → headers.

Quick Check

You picked an exchange type. Now match the routing behavior to the job.

Recap

That's RabbitMQ routing: exchanges route, queues store, bindings connect — and direct, fanout, and topic each shape how messages flow.

Perguntas Frequentes

A aula “Exchanges, filas e vinculações explicados” é grátis?

Sim — o texto completo de “Exchanges, filas e vinculações explicados” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de RabbitMQ Messaging & Async Systems, atualize para CoddyKit PRO. O curso de RabbitMQ Messaging & Async Systems inclui 4 aulas no total.

O que vou aprender em “Exchanges, filas e vinculações explicados”?

Aprenda os principais blocos de roteamento do RabbitMQ — exchanges, filas e vinculações — e como as mensagens fluem dos produtores aos consumidores. Você pratica RabbitMQ Messaging & Async Systems com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar RabbitMQ Messaging & Async Systems?

Nenhuma experiência prévia é necessária. RabbitMQ Messaging & Async Systems no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.

Quanto tempo leva a aula “Exchanges, filas e vinculações explicados”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de RabbitMQ Messaging & Async Systems?

Sim. Cada aula de RabbitMQ Messaging & Async Systems inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. O que são filas de mensagens?
  2. Arquitetura do RabbitMQ explicada
  3. Configurando o RabbitMQ localmente
  4. Exchanges, filas e vinculações explicados
← Voltar para RabbitMQ Messaging & Async Systems