[rabbitmq-discuss] Strange behavior when accessing properties of a delivered message (in Java)

eric.arendt ejarendt at gmail.com
Wed Aug 11 00:24:55 BST 2010


Hi,

I'm running RabbitMQ 1.8.1 with the 1.8.1 Java API, and I'm getting some
very strange behavior when I receive messages.  Suppose I do the following:

// This is fine
QueueingConsumer.Delivery delivery = consumer.nextDelivery();
AMQP.BasicProperties properties = delivery.getProperties();

// But when I do this...
properties.getDeliveryMode();

I don't get a null pointer, I don't get any kind of exception.  Rather, the
thread of execution either hangs, or in the case of a threaded application,
restarts (as if this was a "GOTO" statement or something).

My conclusion is that getting the delivery mode of a delivered message in
this manner is not an appropriate thing to do, but I just spent three hours
trying to figure out why doing this caused execution to hang or reset.  It's
the strangest thing.  I fixed the problem by not touching the properties of
a delivered message.

Any ideas?
-- 
View this message in context: http://old.nabble.com/Strange-behavior-when-accessing-properties-of-a-delivered-message-%28in-Java%29-tp29403410p29403410.html
Sent from the RabbitMQ mailing list archive at Nabble.com.



More information about the rabbitmq-discuss mailing list