File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
test/src/com/rabbitmq/client/test/functional Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,29 @@ public void testRollbackNacks()
401401 assertNull (basicGet ());
402402 }
403403
404+ public void testCommitAcksAndNacks ()
405+ throws IOException
406+ {
407+ for (int i = 0 ; i < 3 ; i ++) {
408+ basicPublish ();
409+ }
410+ txSelect ();
411+ long tags [] = new long [3 ];
412+ for (int i = 0 ; i < 3 ; i ++) {
413+ tags [i ] = basicGet ().getEnvelope ().getDeliveryTag ();
414+ }
415+ basicAck (tags [1 ], false );
416+ basicAck (tags [0 ], false );
417+ basicNack (tags [2 ], false , false );
418+ txRollback ();
419+ basicAck (tags [2 ], false );
420+ basicNack (tags [0 ], false , true );
421+ basicNack (tags [1 ], false , false );
422+ txCommit ();
423+ assertNotNull (basicGet ());
424+ assertNull (basicGet ());
425+ }
426+
404427 /*
405428 messages with rejects get requeued after the transaction commit.
406429 messages with rejects with requeue = false are not requeued.
@@ -435,5 +458,4 @@ public void testRollbackRejects()
435458 txRollback ();
436459 assertNull (basicGet ());
437460 }
438-
439461}
You can’t perform that action at this time.
0 commit comments