[rabbitmq-discuss] channel.txCommit() gets hung/blocks
Praveen M
lefthandmagic at gmail.com
Thu Oct 20 01:55:34 BST 2011
Hi,
I'm faced a weird case,
I started using transacted channels. I had set my channels with
channel.txSelect();
In the consumer that I defined (please see code below) , whenever my code
reaches the point where this.getChannel().txCommit() the thread just hangs
and doesn't move forward. I'm using a rabbit server and client (java) of
2.6.1 version.
Any help will be great.
Thank you,
Praveen
import java.io.IOException;
import com.rabbitmq.client.*;
public class SmartQConsumer extends DefaultConsumer {
RabbitMqHandler rabbitHandler;
public SmartQConsumer(Channel channel, RabbitMqHandler rabbitHandler) {
super(channel);
this.rabbitHandler = rabbitHandler;
}
@Override
public void handleDelivery(String consumerTag, Envelope envelope,
AMQP.BasicProperties properties, byte[] body) {
try {
rabbitHandler.onMessage(1000, body);
this.getChannel().basicAck(envelope.getDeliveryTag(), false);
this.getChannel().txCommit(); *//hangs/blocks here*
} catch (Exception x) {
try {
this.getChannel().txRollback();
} catch (IOException x1) {
x1.printStackTrace();
}
x.printStackTrace();
}
}
}
--
-Praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111019/58e45555/attachment.htm>
More information about the rabbitmq-discuss
mailing list