Hello,
I'm having trouble restricting the prefetch count in Java Client 3.5.4 connecting to server 3.5.3.
Here's how I'm setting up my connection:
ConnectionFactory factory = new ConnectionFactory();
factory.setUsername(BrokerUsername);
factory.setPassword(BrokerPassword);
factory.setVirtualHost(BrokerVirtualHost);
factory.setHost(BrokerHostname);
Connection conn = factory.newConnection();
Channel channel = conn.createChannel();
QueueingConsumer consumer = new QueueingConsumer(channel);
channel.basicConsume(InboundQueueName, autoAck, consumer);
channel.basicQos(50, true);
while(true) {
QueueingConsumer.Delivery delivery = consumer.nextDelivery(1000);
Envelope envelope = delivery.getEnvelope();
if(delivery != null) {
//do something
consumer.getChannel().basicAck(envelope.getDeliveryTag(), false);
}
}
The problem I'm having is that the server seems to be sending way more that 50 messages to the client. I think I must be mis-using basicQos, or maybe I have a fundamental misunderstanding of how it works.
Any help would be hugely appreciated! (Details follow)
Thanks!
-Dave
In this example I have one consumer with a single thread. For some reason the Queue shows the Prefetch count = 0 even though there are 126 Unacked messages. The Queue looks like this:

When I drill down to the channel level I see that there is a global prefetch count of 50 set on the consumer but that the consumer still has 200 unacked messages:
