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.

Search Discussions

  • Rob Harrop at Oct 14, 2010 at 1:56 pm
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedOct 12, '10 at 9:43a
activeOct 14, '10 at 1:56p
posts2
users2
websiterabbitmq.com
irc#rabbitmq

2 users in discussion

Azzuwan: 1 post Rob Harrop: 1 post

People

Translate

site design / logo © 2022 Grokbase