summaryrefslogtreecommitdiff
path: root/qpid/java/client
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-04-29 18:18:36 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-04-29 18:18:36 +0000
commit413786578ebb3eda205d03d0adb9610a1affa602 (patch)
tree3e64c6bd1932a3bb88266dcbb17924070a246c7b /qpid/java/client
parent97fcae0f7f5eafa4a371cf4307458949ac602479 (diff)
downloadqpid-python-413786578ebb3eda205d03d0adb9610a1affa602.tar.gz
This is a fix for QPID-2559
A test case will be checked in shortly. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@939416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
index f4b40e06b8..2d421ef03f 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
@@ -588,9 +588,11 @@ public class AMQSession_0_10 extends AMQSession<BasicMessageConsumer_0_10, Basic
}
getQpidSession().messageFlow(consumerTag, MessageCreditUnit.BYTE, 0xFFFFFFFF,
Option.UNRELIABLE);
- // We need to sync so that we get notify of an error.
- // only if not immediate prefetch
- if(prefetch() && (isStarted() || _immediatePrefetch))
+
+ // If the session is suspended credits should not be set as it will also
+ // set credits when the the session is unsuspended, resulting in too many
+ // messages than required.
+ if(prefetch() && !isSuspended() && (isStarted() || _immediatePrefetch))
{
// set the flow
getQpidSession().messageFlow(consumerTag,