summaryrefslogtreecommitdiff
path: root/java
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
commit704df93d8745d26bb19fb9f45ca409428bea28ee (patch)
tree3be70f5b5de34b4d83417d97e305caaaf8a9ffcc /java
parent75543e5d71a4e4cfe1e8a985c64fcadab9865ad4 (diff)
downloadqpid-python-704df93d8745d26bb19fb9f45ca409428bea28ee.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/qpid@939416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
index f4b40e06b8..2d421ef03f 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
+++ b/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,