Skip to content

Commit 7baea97

Browse files
author
Steve Powell
committed
Producer rate control interferes with confirm limits.
Move rate control delay to before confirm.acquire, since the latter may block, spoiling the rate calculations; also move now setting to after handleSend, since a report might delay the loop and prevent termination when it should.
1 parent a3e1d1a commit 7baea97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/src/com/rabbitmq/examples/perf/Producer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ public void run() {
132132

133133
while ((timeLimit == 0 || now < startTime + timeLimit) &&
134134
(msgLimit == 0 || msgCount < msgLimit)) {
135+
delay(now);
135136
if (confirmPool != null) {
136137
confirmPool.acquire();
137138
}
138-
delay(now);
139139
publish(createMessage(totalMsgCount));
140140
totalMsgCount++;
141141
msgCount++;
142142

143143
if (txSize != 0 && totalMsgCount % txSize == 0) {
144144
channel.txCommit();
145145
}
146-
now = System.currentTimeMillis();
147146
stats.handleSend();
147+
now = System.currentTimeMillis();
148148
}
149149

150150
} catch (IOException e) {

0 commit comments

Comments
 (0)