Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
proton-0.14.0
-
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()).