You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Nic Grounds (JIRA)" <ji...@apache.org> on 2007/10/10 17:22:23 UTC
[jira] Created: (AMQ-1457) Can't set properties on
ActiveMQBytesMessage after a reset()
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.
[jira] Resolved: (AMQ-1457) Can't set properties on
ActiveMQBytesMessage after a reset()
Posted by "Hiram Chirino (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Commented: (AMQ-1457) Can't set properties on
ActiveMQBytesMessage after a reset()
Posted by "Nic Grounds (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/AMQ-1457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40332 ]
Nic Grounds commented on AMQ-1457:
----------------------------------
As clarification, the property I need to set on the ActiveMQBytesMessage includes more information than simple the message length (but it is important the the message length be embedded in this other information).
> 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.