O'Reilly logo

RabbitMQ Cookbook by Sigismondo Boschi, Gabriele Santomaggio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving bandwidth

Using noAck flag and managing the prefetch parameter is another client-side way to improve the performance and the bandwidth. Both noAck and prefetch are used by the consumers.

In this example, we are going to create one producer and one consumer using these parameters. You can find the source code at Chapter08/Recipe03.

Getting ready

You need Java 1.7 or higher and Apache maven.

How to do it…

We skip the producer code because it's the same one shown in the Multithreading and queues recipe. We still use the ReliableClient class as the base class. Let's see the consumer by performing the following steps:

  1. Create a maven project and add the RabbitMQ client dependency.
  2. Create a consumer main class, which reads from args[] to manage the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required