[rabbitmq-discuss] Consumer Not Getting Message

Rob Harrop rob at rabbitmq.com
Thu Oct 14 14:56:49 BST 2010


On the face of it the code looks fine.

Just to check, do you see GETTING MESSAGE printed out the second time?

Is it possible for you to pull this out of an EJB and run it standalone? I doubt that it is anything specific about the JBoss environment but it's worth checking to be sure. 

Is there anything of interest in the Rabbit logs?

Regards,

Rob

On 12 Oct 2010, at 10:43, azzuwan wrote:

> 
> 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) {
>                    logger.info(ie.getMessage());
>                    continue;
>                }                
> 
>                ....
>            }
> 
> 
> 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.
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list