Qpid Proton
  1. Qpid Proton
  2. PROTON-204

Handling of partial messages is broken in java messenger

    Details

    • Type: Bug Bug
    • Status: Closed
    • 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

        Gordon Sim created issue -
        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;
        Show
        Gordon Sim added a comment - Fixed by http://svn.apache.org/viewvc?rev=1441176&view=rev
        Gordon Sim made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Robbie Gemmell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        3d 1h 32m 1 Gordon Sim 31/Jan/13 20:19
        Resolved Resolved Closed Closed
        1070d 15h 12m 1 Robbie Gemmell 07/Jan/16 11:32

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development