Understanding the alternate exchange extension

We have already seen how to deal with messages published to an exchange that do not reach any queue in the Handling unroutable messages recipe in Chapter 1, Working with AMQP. AMQP lets the producer be acknowledged on this condition that can eventually decide whether to deliver the messages again to a different destination.

With this extension, we can specify an alternate exchange in which the broker will route these messages, without any more intervention from the producer, as shown in the sources of this recipe in Chapter02/Recipe05/Java/src/rmqexample.

Getting ready

To use this recipe, we need to set up the Java development environment, as indicated in the Introduction section of Chapter 1, Working ...

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.