Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 93153 invoked from network); 9 Apr 2008 14:00:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Apr 2008 14:00:22 -0000 Received: (qmail 5062 invoked by uid 500); 9 Apr 2008 14:00:21 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 5033 invoked by uid 500); 9 Apr 2008 14:00:21 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 5019 invoked by uid 99); 9 Apr 2008 14:00:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2008 07:00:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2008 13:59:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B1875234C0C1 for ; Wed, 9 Apr 2008 06:57:32 -0700 (PDT) Message-ID: <1257877931.1207749452725.JavaMail.jira@brutus> Date: Wed, 9 Apr 2008 06:57:32 -0700 (PDT) From: "Hiram Chirino (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQ-1457) Can't set properties on ActiveMQBytesMessage after a reset() In-Reply-To: <10689987.1192029743434.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on 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.