Qpid Proton
  1. Qpid Proton
  2. PROTON-204

Handling of partial messages is broken in java messenger

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: 0.4
    • Component/s: proton-j
    • Labels:
      None

      Description

      I.e. where a read from the network reads part of a message but doesn't get all the data yet. This exhibits itself as a buffer underflow in MessengerImpl.get().

        Activity

        Show
        Gordon Sim added a comment - Fixed by http://svn.apache.org/viewvc?rev=1441176&view=rev
        Hide
        Gordon Sim added a comment -

        This requires an additional method to be exposed on Delivery, equivalent to pn_delivery_partial(). Patch posted below in case there is any comment, but it is a trivial addition:

        Index: proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Delivery.java
        ===================================================================
        --- proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Delivery.java	(revision 1439491)
        +++ proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Delivery.java	(working copy)
        @@ -68,4 +68,6 @@
             public Object getContext();
         
             public boolean isUpdated();
        +
        +    public boolean isPartial();
         }
        Index: proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java
        ===================================================================
        --- proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java	(revision 1439491)
        +++ proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java	(working copy)
        @@ -408,6 +408,11 @@
                 _complete = true;
             }
         
        +    public boolean isPartial()
        +    {
        +        return !_complete;
        +    }
        +
             void setRemoteDeliveryState(DeliveryState remoteDeliveryState)
             {
                 _remoteDeliveryState = remoteDeliveryState;
        
        
        Show
        Gordon Sim added a comment - This requires an additional method to be exposed on Delivery, equivalent to pn_delivery_partial(). Patch posted below in case there is any comment, but it is a trivial addition: Index: proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Delivery.java =================================================================== --- proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Delivery.java (revision 1439491) +++ proton-j/proton-api/src/main/java/org/apache/qpid/proton/engine/Delivery.java (working copy) @@ -68,4 +68,6 @@ public Object getContext(); public boolean isUpdated(); + + public boolean isPartial(); } Index: proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java =================================================================== --- proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java (revision 1439491) +++ proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/DeliveryImpl.java (working copy) @@ -408,6 +408,11 @@ _complete = true; } + public boolean isPartial() + { + return !_complete; + } + void setRemoteDeliveryState(DeliveryState remoteDeliveryState) { _remoteDeliveryState = remoteDeliveryState;

          People

          • Assignee:
            Gordon Sim
            Reporter:
            Gordon Sim
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development