On Thu, Aug 19, 2010 at 4:46 AM, BenXS <bxsto...@yahoo.co.uk> wrote: > > I am trying to set from a Java bean a new (additional) Property in header. > Therefore I code (simplified) the following: > > > public void pass(Message mess) { > ... > mess.setPropertiesModifiable(true); > mess.setStringProperty("newprop", "value123"); > ...} > > But it didn't work. > > Compiler complains about cannot find symbol for "setPropertiesModifiable". > > If omit it the setPropertiesModifiable() statement then at runtime I get an > exception > java.jms.MessageNotWriteableException: Message properties are read only > > So how do I resolve that?
It looks like you are trying to modify a message that was just received. The problem with this is that messages are immutable once they have been sent by the producer. Also, the setPropertiesModifiable method is not from ActiveMQ, are you using a different vendor's JMS API? To work around this, just create a new message and copy anything from the existing message that you need. With a new message, you will be able to set properties without a problem. Bruce -- perl -e 'print unpack("u30","D0G)u8...@4vyy9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' ActiveMQ in Action: http://bit.ly/2je6cQ Blog: http://bruceblog.org/ Twitter: http://twitter.com/brucesnyder