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

Matthias Radestock matthias at rabbitmq.com
Wed Aug 11 06:59:07 BST 2010


Eric,

eric.arendt wrote:
> 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).

The underlying implementation looks like this:

         public java.lang.Integer getDeliveryMode() { return deliveryMode; }

So there is nothing peculiar going on there. Unless perhaps the delivery 
mode isn't set at all, in which case the above will return 'null', which 
if you tried to assign to an int would cause things to break.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list