@@ -114,6 +114,16 @@ public void testMessageLimitUnlimited()
114114 drain (c , 2 );
115115 }
116116
117+ public void testNoAckUnlimited ()
118+ throws IOException
119+ {
120+ QueueingConsumer c = new QueueingConsumer (channel );
121+ declareBindConsume (channel , c , true );
122+ channel .basicQos (1 );
123+ fill (2 );
124+ drain (c , 2 );
125+ }
126+
117127 public void testPermutations ()
118128 throws IOException
119129 {
@@ -232,8 +242,8 @@ public void testLimitingMultipleChannels()
232242 Channel ch2 = connection .createChannel ();
233243 QueueingConsumer c1 = new QueueingConsumer (ch1 );
234244 QueueingConsumer c2 = new QueueingConsumer (ch2 );
235- String q1 = declareBindConsume (ch1 , c1 );
236- String q2 = declareBindConsume (ch2 , c2 );
245+ String q1 = declareBindConsume (ch1 , c1 , false );
246+ String q2 = declareBindConsume (ch2 , c2 , false );
237247 ch1 .basicConsume (q2 , false , c1 );
238248 ch2 .basicConsume (q1 , false , c2 );
239249 ch1 .basicQos (1 );
@@ -349,16 +359,18 @@ protected Queue<Delivery> configure(QueueingConsumer c,
349359 protected String declareBindConsume (QueueingConsumer c )
350360 throws IOException
351361 {
352- return declareBindConsume (channel , c );
362+ return declareBindConsume (channel , c , false );
353363 }
354364
355- protected String declareBindConsume (Channel ch , QueueingConsumer c )
365+ protected String declareBindConsume (Channel ch ,
366+ QueueingConsumer c ,
367+ boolean noAck )
356368 throws IOException
357369 {
358370 AMQP .Queue .DeclareOk ok = ch .queueDeclare ();
359371 String queue = ok .getQueue ();
360372 ch .queueBind (queue , "amq.fanout" , "" );
361- ch .basicConsume (queue , false , c );
373+ ch .basicConsume (queue , noAck , c );
362374 return queue ;
363375 }
364376
0 commit comments