File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
test/src/com/rabbitmq/client/test/functional Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,11 @@ public void testDeclareQueueWithRoutingKeyButNoDeadLetterExchange()
8484 }
8585
8686 public void testDeadLetterQueueTTLExpiredMessages () throws Exception {
87- Map < String , Object > args = new HashMap < String , Object >( );
88- args . put ( "x-message-ttl" , 1000 );
87+ ttlTest ( 1000 );
88+ }
8989
90- deadLetterTest (new Runnable () {
91- public void run () {
92- sleep (2000 );
93- }
94- }, args , "expired" );
90+ public void testDeadLetterQueueZeroTTLExpiredMessages () throws Exception {
91+ ttlTest (0 );
9592 }
9693
9794 public void testDeadLetterDeletedDLX () throws Exception {
@@ -309,6 +306,14 @@ public void process(GetResponse getResponse) {
309306 });
310307 }
311308
309+ private void ttlTest (final long ttl ) throws Exception {
310+ Map <String , Object > args = new HashMap <String , Object >();
311+ args .put ("x-message-ttl" , ttl );
312+ deadLetterTest (new Runnable () {
313+ public void run () { sleep (ttl + 1000 ); }
314+ }, args , "expired" );
315+ }
316+
312317 private void sleep (long millis ) {
313318 try {
314319 Thread .sleep (millis );
You can’t perform that action at this time.
0 commit comments