A-MQ OpenWire client: setObjectProperty() fails on ActiveMQBytesMessage

Solution Verified - Updated -

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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content