Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1299

[proton-j] the Link#getRemoteCredit() method return value isn't suitable for sending links

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-0.14.0
    • proton-0.15.0
    • proton-j
    • None

    Description

      The Link interface has a getRemoteCredit() method for getting a local view of the 'effective remote credit' for the link based on current credit and queued messages. This has historically returned the value 'credit - queued' for both sending and receiving links. That makes no sense for sending links since the credit value for them already incorporates the effect of any sent messages still buffered in the engine, so subtracting the queued count from this just applies the send effect twice if there are actually queued messages, leading the value to be misleading.

      The method should probably only have been defined for receiving links (or not at all given the queued count is able to be inspected separately), but rather than break the API by moving it to the Reciever interface, the implementation should just be updated to ensure an appropriate answer is given for sending links (by making it the same as calling getCredit()).

      Attachments

        Activity

          People

            robbie Robbie Gemmell
            robbie Robbie Gemmell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: