You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (Commented) (JIRA)" <ji...@apache.org> on 2012/02/24 00:53:48 UTC
[jira] [Commented] (QPID-1199) Can't append to BytesMessage after
send
[ https://issues.apache.org/jira/browse/QPID-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13215213#comment-13215213 ]
Rob Godfrey commented on QPID-1199:
-----------------------------------
I've added a variation of the test on the JIRA to BytesMessageTest, and it passes against the current code base
> Can't append to BytesMessage after send
> ---------------------------------------
>
> Key: QPID-1199
> URL: https://issues.apache.org/jira/browse/QPID-1199
> Project: Qpid
> Issue Type: Improvement
> Components: Java Client
> Affects Versions: M2.1, M3
> Reporter: Aidan Skinner
> Assignee: Rob Godfrey
> Priority: Minor
>
> The following code throws an exception on the second iteration of the loop:
> public void testModificationAfterSend() throws Exception
> {
> Connection connection = getConnection();
> Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> BytesMessage jmsMsg = session.createBytesMessage();
> Destination destination = new AMQQueue("amq.direct", randomize("BytesMessageTest"));
> /** Set the constant message contents. */
> jmsMsg.setStringProperty(
> "foo", "test"
> );
> /** Pre-populate the message body buffer to the target size. */
> byte[] jmsMsgBodyBuffer = new byte[1024];
> for(int i=0;i<jmsMsgBodyBuffer.length;i++)
> {
> jmsMsgBodyBuffer[i] = (byte) 0xF;
> }
> /**
> * Send messages.
> */
> MessageProducer producer = session.createProducer(destination);
> for(int writtenMsgCount = 0; writtenMsgCount < 10; writtenMsgCount++){
> /** Set the per send message contents. */
> jmsMsgBodyBuffer[0] = (byte) writtenMsgCount;
> jmsMsg.writeBytes(jmsMsgBodyBuffer,0,jmsMsgBodyBuffer.length);
> /** Try to write a message. */
> producer.send(jmsMsg);
> }
> }
> AFAICT there is no reason for us to not allow this to work (although it's a bit odd)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org