[rabbitmq-discuss] a weird question about rabbitmq.thanks a lot

yby538 yby538 at 163.com
Tue Oct 22 02:40:27 BST 2013


hi,all

i use "rabbitmqctrl list_queues" to list the queues in my computer and the result is like this:



that is to say ,there are 17 messages in youdao_box_ctp queue and by the way,the queue is defined like this:

channelSTC.queueDeclare("youdao_box_ctp", true, false, false, null);

here is my code to get the message:

     ConnectionFactory factoryCTP = new ConnectionFactory();
     factoryCTP.setHost("localhost");
     Connection connectionProxy=factoryCTP.newConnection();
     Channel channameProxy=connectionProxy.createChannel();
     channameProxy.queueDeclare("youdao_box_ctp", true, false, false, null);
     channameProxy.basicQos(1);
     while(true)
     {
      GetResponse response = channameProxy.basicGet("youdao_box_ctp", false);
         if(response!=null)
         {
          channameProxy.basicAck(response.getEnvelope().getDeliveryTag(), false);
         }
         else
         {
          System.out.println("empty");
         }
     }

it prints "empty" !!!! why???there are 17 messages in youdao_box_ctp!!!

the same thing happened to the other queues also

thanks a lot

2013-10-22



yby538
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131022/73f28b5b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 123456.jpg
Type: image/jpeg
Size: 18474 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131022/73f28b5b/attachment.jpg>


More information about the rabbitmq-discuss mailing list