|RabbitMQ Java Client||All|
The scope of this article is to provide guidance for tuning attributes to maximize throughput for Java RabbitMQ clients.
Here are some ways that you can get more throughput in your Java client.
- Consider using Channel.basicConsume instead of Channel.basicGet. If basicConsume is used, messages are delivered automatically as they arrive as compared to basicGet where you explicitly request for messages to arrive.
- Consider using autoAck = true rather than manually doing basicAck or basicNack.
- Increasing prefetchCount and prefetchSize will also increase consumer utilization.
- Use smaller messages rather than large messages as this affects latency.
- Increase concurrency of your consumers, so that consumers can scale as messages increases.