A-MQ OpenWire client: setObjectProperty() fails on ActiveMQBytesMessage
Issue
After receiving a JMS BytesMessage (ActiveMQBytesMessage)12, calling:
message.clearProperties();
message.setObjectProperty("key","value" );
... fails with MessageNotWriteableException
. This is incorrect as it must be possible to set a JMS message property after a call to 'clearProperties()', regardless the writeable state of the message body (as per JMS specification/JavaDoc)
Problem is limited to the combination BytesMessage+ObjectProperty (i.e. not other message types or other property types).
The overriden method 'setObjectProperty()' in class 'ActiveMQBytesMessage.java' should just be deleted - and this should fix the issue. Indeed this method erroneously makes a call to initializeWriting(), which creates the exception.
Environment
- Red Hat AMQ 6.3
- OpenWire Client
- BytesMessage+ObjectProperty
- OpenWire Client
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.