Skip to content

Commit d0176bd

Browse files
author
Alexandru Scvortov
committed
add test for ack shuffling before rollback
1 parent 8f30ec2 commit d0176bd

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/src/com/rabbitmq/client/test/functional/Transactions.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,34 @@ public void testCommitWithDeletedQueue()
343343
}
344344
}
345345

346+
public void testShuffleAcksBeforeRollback()
347+
throws IOException
348+
{
349+
openChannel();
350+
try {
351+
createResources();
352+
for (int i = 0; i < 3; i++) {
353+
basicPublish();
354+
}
355+
txSelect();
356+
long tags[] = new long[3];
357+
for (int i = 0; i < 3; i++) {
358+
tags[i] = basicGet().getEnvelope().getDeliveryTag();
359+
}
360+
basicAck(tags[2], false);
361+
basicAck(tags[1], false);
362+
txRollback();
363+
basicAck(tags[0], true);
364+
basicAck(tags[1], false);
365+
basicAck(tags[2], false);
366+
txCommit();
367+
} catch (IOException e) {
368+
closeConnection();
369+
openConnection();
370+
openChannel();
371+
throw e;
372+
} finally {
373+
closeChannel();
374+
}
375+
}
346376
}

0 commit comments

Comments
 (0)