[rabbitmq-discuss] Consumer Not Getting Message

azzuwan azzuwan at gmail.com
Tue Oct 12 10:43:29 BST 2010

I'm using Rabbit MQ 1.8.0 and connecting using the java client from an EJB in
JBOSS 5.1.

I'm having a problem while trying to get message from the queue using the
following codes

QueueingConsumer consumer = new QueueingConsumer(replyChannel);
            replyChannel.basicConsume(replyQueueName, consumer);
            boolean run = true;

            logger.info("BEFORE LOOP");
            while (run) {
                QueueingConsumer.Delivery delivery = null;
                logger.info("GETTING MESSAGE");
                try {                    

                    delivery = consumer.nextDelivery();
                    logger.info("MESSAGE RECIEVED STATE ");
replyChannel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);


                } catch (InterruptedException ie) {

I managed to get the first message successfully but the second and
subsequent messages never gets delivered.
>From the output, it seems that the attempt to get the message stuck at 
delivery = consumer.nextDelivery() .
MESSAGE RECIEVED STATE gets print out for the first time only.
>From then on, all the messages gets piled up in the queue.
Any idea why?

View this message in context: http://old.nabble.com/Consumer-Not-Getting-Message-tp29941664p29941664.html
Sent from the RabbitMQ mailing list archive at Nabble.com.

More information about the rabbitmq-discuss mailing list