File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
test/src/com/rabbitmq/client/test/functional Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments