[rabbitmq-discuss] Consuming a Rollbacked Message

Amin Abbaspour abbaspour_amin at yahoo.com
Sun Apr 26 12:43:17 BST 2009


Dear All,

In my Java client, I cannot receive a message after I rollbacked its previous transaction and entry is returned to queue.

I open a transactional channel:
----
channel = connection.createChannel();
channel.queueDeclare(queueName);
consumer = new QueueingConsumer(channel);
channel.basicConsume(queueName, consumer);
channel.txSelect();
----

And rollback like this:
----
channel.txRollback();
----

but then this consumer does not receive anything from queue:
----
final QueueingConsumer.Delivery delivery = consumer.nextDelivery();
channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
----

This is while I can see that I have the entry in queue (via rabbitmqctl list_queues) and consumer receives this entry after I restart the application.

What I can? Is there something wrong with my rollback or ACK mechanism? should I do something more than a simple txRollback()?

I use the latest client and server (1.5.4). Java client in Ubuntu server.

Kind Regards,
Amin Abbaspour
http://twitter.com/abbaspour



      




More information about the rabbitmq-discuss mailing list