In this recipe we are closing the loop; we have already seen how to send messages to RabbitMQ—or to any AMQP broker—and now we are ready to learn how to retrieve them.
You can find the source code of the recipe at
To use this recipe we need to set up the Java development environment as indicated in the introduction.
In order to consume the messages sent as seen in the previous recipe, perform the following steps:
String myQueue="myFirstQueue"; channel.queueDeclare(myQueue, true, false, false, null);
public class ActualConsumer extends ...