Filtering and forwarding messages

In this recipe we are going to implement a selective message forwarding. We will let the shovel plugin forward the subsets of messages to different destinations. A possible use case of this example is a company with three different sites having the following responsibilities:

  • One that takes book orders
  • One that needs only the orders with london as the routing key
  • One that needs only the orders with rome as the routing key

The aim is to forward messages selectively by adding or removing shovels without touching the source broker as follows:

Filtering and forwarding messages

Getting ready

You need three brokers; we will name them rabbitmq@rabbitmqc1,

Get RabbitMQ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.