[
https://issues.apache.org/activemq/browse/AMQ-1457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hiram Chirino resolved AMQ-1457.
--------------------------------
Resolution: Won't Fix
You could always just write your data to a ByteArrayOutputStream then get the
resulting byte[] to find out the length and then write that to message.
I looks to me like this patch would violate the read-only bit of the spec so
I'm not leaning towards applying it.
> Can't set properties on ActiveMQBytesMessage after a reset()
> ------------------------------------------------------------
>
> Key: AMQ-1457
> URL: https://issues.apache.org/activemq/browse/AMQ-1457
> Project: ActiveMQ
> Issue Type: Improvement
> Affects Versions: 4.1.1, 5.0.0
> Reporter: Nic Grounds
> Attachments: propertyAfterReset.patch
>
>
> Once the reset() method has been called on an ActiveMQBytesMessage object,
> properties can no longer be set. The use case is that I need to set a
> property to represent the message length (number of bytes) but I can't
> determine that (using the getBodyLength() method) until after a call to
> reset().
> A very crude patch is included which prevents the [unnecessary?] assumption
> that the ActiveMQBytesMessage may be uninitialized when setting an object
> property.
> Note: the documentation for a JMS BytesMessage API documentation states that
> the reset() method puts the BytesMessage into read-only mode but whether this
> applies to the body only or to the body and properties is unclear.
> I marked this issue as an improvement because I'm not convinced whether it is
> a bug or whether there is a another, better way to accomplish what I'm trying
> to do.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.