ARTEMIS-2062: avoid superfluous attempt to flow credit. This closes #2277.

This commit is contained in:
Robbie Gemmell 2018-08-29 10:53:34 +01:00
commit 4109ffc0c6
1 changed files with 3 additions and 1 deletions

View File

@ -299,7 +299,9 @@ public class ProtonServerReceiverContext extends ProtonInitializable implements
public void flow(int credits, int threshold) {
// Use the SessionSPI to allocate producer credits, or default, always allocate credit.
if (sessionSPI != null) {
sessionSPI.offerProducerCredit(address, credits, threshold, receiver);
if (receiver.getCredit() <= threshold) {
sessionSPI.offerProducerCredit(address, credits, threshold, receiver);
}
} else {
connection.lock();
try {