We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24d0764 commit 18e4933Copy full SHA for 18e4933
test/src/com/rabbitmq/examples/ConfirmDontLoseMessages.java
@@ -78,17 +78,16 @@ public void run() {
78
public void handleAck(long seqNo,
79
boolean multiple) {
80
if (multiple) {
81
- for (long i = ackSet.first(); i <= seqNo; ++i)
82
- ackSet.remove(i);
+ ackSet.headSet(seqNo+1).clear();
83
} else {
84
- ackSet.remove(seqNo);
+ ackSet.remove(seqNo);
85
}
86
87
});
88
89
// Publish
90
for (long i = 0; i < MSG_COUNT; ++i) {
91
- ackSet.add(i);
+ ackSet.add(ch.getNextPublishSeqNo());
92
ch.basicPublish("", QUEUE_NAME,
93
MessageProperties.PERSISTENT_BASIC,
94
"nop".getBytes());
0 commit comments