[EMAIL PROTECTED] wrote:
Author: arnaudsimon
Date: Thu Jun 26 01:47:29 2008
New Revision: 671825
URL: http://svn.apache.org/viewvc?rev=671825&view=rev
Log:
QPID-1112: Changed addDeliveredMessage so to avoid division by 0 error when
messages are not pre-fetched
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=671825&r1=671824&r2=671825&view=diff
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
Thu Jun 26 01:47:29 2008
@@ -758,7 +758,7 @@
_txRangeSet.add((int) id);
_txSize++;
// this is a heuristic, we may want to have that configurable
- if( _txSize % (_connection.getMaxPrefetch() / 2) == 0 )
+ if( _connection.getMaxPrefetch() != 0 && _txSize %
(_connection.getMaxPrefetch() / 2) == 0 )
{
// send completed so consumer credits don't dry up
getQpidSession().messageAcknowledge(_txRangeSet, false);
Should that be _connection.getMaxPrefetch() > 1? Doesn't 1 / 2 come out
as zero in Java?
--Rafael