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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.