[rabbitmq-discuss] does client caches messages?

Mohsen Lotfizad mtlotfizad at gmail.com
Sat May 11 12:42:30 BST 2013


I download the Recv.java<http://github.com/rabbitmq/rabbitmq-tutorials/blob/master/java/Recv.java>
and change some of its code to this:

*        ConnectionFactory factory = new ConnectionFactory();
         //factory.setHost("localhost");
        factory.setUri("amqp://guest:guest@127.0.0.1:5672");
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();

        channel.queueDeclarePassive(QUEUE_NAME);
        System.out.println(" [*] Waiting for messages. To exit press
CTRL+C");

        QueueingConsumer consumer = new QueueingConsumer(channel);
        channel.basicConsume(QUEUE_NAME, false, consumer);
        channel.basicQos(1);

**
*

On Sat, May 11, 2013 at 12:14 PM, Matthias Radestock
<matthias at rabbitmq.com>wrote:

> On 11/05/13 08:36, Mohsen Lotfizad wrote:
>
>> In fact I just want to know when I set prefetch_cont=2, why my consumer
>> try to give about 700 messages?
>>
>
> How is your consumer consuming messages? With basic.consume or basic.get?
> Prefetch does not apply to the latter since the client is explicitly asking
> for the next message.
>
> Matthias.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130511/1cdf11d1/attachment.htm>


More information about the rabbitmq-discuss mailing list