qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Ritchie (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Updated: (QPID-223) Sending the same message multiple times results in a MessageNotWriteable exception
Date Wed, 20 Dec 2006 13:22:21 GMT
     [ http://issues.apache.org/jira/browse/QPID-223?page=all ]

Martin Ritchie updated QPID-223:
--------------------------------

        Summary: Sending the same message multiple times results in a MessageNotWriteable
exception  (was: TopicConnTests#connNotStartedTopicTest failing.)
    Description: 
Sending the same message multiple times results in a MessageNotWriteable exception

This is due to the fact that this test resends the same TextMessage many times but the reset
method on AbstractJMSMessage was performing a flip() on the buffer rather a rewind() between
each message send. This was caused by the logic that decides whether to perform a flip or
rewind being driven by the _isReadable flag when really the choice should be made depending
on whether or not the buffer has 'just been written to' as opposed to 'just read'. A new flag
to distinguish these two conditions, _changedData, has been introduced into AbstractJMSMessage
and all methods in its derived child classes set this flag whenever they have just written
to the buffer, so that the next reset and subsequent resets work correctly.

The _changedData flag is initially set to true if an AbstractJMSMessage is created with no
data, so that reset works correctly on null messages. When AbstractJMSMessage is created with
data, the buffer passed to it has already been flipped, so _changedData is set to false.

A patch to fix this is included.

  was:
TopicConnTests#connNotStartedTopicTest is failing.

This is due to the fact that this test resends the same TextMessage many times but the reset
method on AbstractJMSMessage was performing a flip() on the buffer rather a rewind() between
each message send. This was caused by the logic that decides whether to perform a flip or
rewind being driven by the _isReadable flag when really the choice should be made depending
on whether or not the buffer has 'just been written to' as opposed to 'just read'. A new flag
to distinguish these two conditions, _changedData, has been introduced into AbstractJMSMessage
and all methods in its derived child classes set this flag whenever they have just written
to the buffer, so that the next reset and subsequent resets work correctly.

The _changedData flag is initially set to true if an AbstractJMSMessage is created with no
data, so that reset works correctly on null messages. When AbstractJMSMessage is created with
data, the buffer passed to it has already been flipped, so _changedData is set to false.

A patch to fix this is included.

       Assignee: Martin Ritchie

> Sending the same message multiple times results in a MessageNotWriteable exception
> ----------------------------------------------------------------------------------
>
>                 Key: QPID-223
>                 URL: http://issues.apache.org/jira/browse/QPID-223
>             Project: Qpid
>          Issue Type: Bug
>          Components: JMS Compliance
>            Reporter: Rupert Smith
>         Assigned To: Martin Ritchie
>         Attachments: QPID-22X.txt
>
>
> Sending the same message multiple times results in a MessageNotWriteable exception
> This is due to the fact that this test resends the same TextMessage many times but the
reset method on AbstractJMSMessage was performing a flip() on the buffer rather a rewind()
between each message send. This was caused by the logic that decides whether to perform a
flip or rewind being driven by the _isReadable flag when really the choice should be made
depending on whether or not the buffer has 'just been written to' as opposed to 'just read'.
A new flag to distinguish these two conditions, _changedData, has been introduced into AbstractJMSMessage
and all methods in its derived child classes set this flag whenever they have just written
to the buffer, so that the next reset and subsequent resets work correctly.
> The _changedData flag is initially set to true if an AbstractJMSMessage is created with
no data, so that reset works correctly on null messages. When AbstractJMSMessage is created
with data, the buffer passed to it has already been flipped, so _changedData is set to false.
> A patch to fix this is included.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message