liveBook · Manning

Exchange

As explained in Quarkus in Action

A RabbitMQ exchange is a message-routing entity that directs published messages to one or more queues.

A RabbitMQ exchange is the routing point behind a messaging channel: published messages go to an exchange, which directs them to one or more queues. In Quarkus, the RabbitMQ connector can map the outgoing `invoices` channel to an `invoices` exchange bound to a queue. section 9.7

Configure an exchange through the channel and connector:

  • Add the `quarkus-messaging-rabbitmq` extension. section 9.7
  • Publish invoices through the `invoices` channel; the connector maps that channel to the RabbitMQ exchange. section 9.7
  • Set `mp.messaging.incoming.invoices-rabbitmq.exchange.name=invoices` and associate the consumer with the `invoices` queue. section 9.7

Routing invoices to BillingService

ReservationService emits an `Invoice` through `invoices`. BillingService consumes `invoices-rabbitmq`; configuring both the exchange and queue as `invoices` connects the producer to the consumer through RabbitMQ. section 9.7

Listing 9.16 Adding the smallrye-rabbitmq connector extension
$ quarkus ext add quarkus-messaging-rabbitmq

Use the connector-extension listing to bootstrap RabbitMQ messaging in a Quarkus application. section 9.7

How Quarkus in Action covers it

How deep it goes
Explains channel mapping and exchange-queue configuration, but does not detail exchange types or routing-key behavior.
Examples
Uses an invoices exchange, invoices queue, ReservationService producer, and BillingService consumer.
What it assumes
Assumes familiarity with Quarkus messaging channels and consumers while introducing RabbitMQ connectivity through a connector.
What you can do after
Apply it via Quarkus Reactive Messaging configuration to connect invoice producers and consumers through RabbitMQ.
How it connects
Connects RabbitMQ exchanges with queues, channels, producers, consumers, and the Quarkus RabbitMQ connector.

Also explained in

Compare how 3 books explain exchange →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.