@@ -42,7 +42,9 @@ groups() ->
42
42
consume_from_empty_queue ,
43
43
consume_and_autoack_from_queue ,
44
44
subscribe_to_queue ,
45
- subscribe_with_autoack_to_queue
45
+ subscribe_with_autoack_to_queue ,
46
+ consume_and_ack_from_queue ,
47
+ subscribe_and_ack_to_queue
46
48
]}
47
49
].
48
50
@@ -270,8 +272,6 @@ publish_and_restart(Config) ->
270
272
wait_for_messages (Config , QQ , <<" 2" >>, <<" 2" >>, <<" 0" >>).
271
273
272
274
consume_from_queue (Config ) ->
273
- % % Test the node restart with both types of queues (quorum and classic) to
274
- % % ensure there are no regressions
275
275
Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
276
276
277
277
Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
@@ -287,8 +287,6 @@ consume_from_queue(Config) ->
287
287
wait_for_messages (Config , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>).
288
288
289
289
consume_and_autoack_from_queue (Config ) ->
290
- % % Test the node restart with both types of queues (quorum and classic) to
291
- % % ensure there are no regressions
292
290
Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
293
291
294
292
Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
@@ -304,8 +302,6 @@ consume_and_autoack_from_queue(Config) ->
304
302
wait_for_messages (Config , QQ , <<" 0" >>, <<" 0" >>, <<" 0" >>).
305
303
306
304
consume_from_empty_queue (Config ) ->
307
- % % Test the node restart with both types of queues (quorum and classic) to
308
- % % ensure there are no regressions
309
305
Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
310
306
311
307
Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
@@ -316,8 +312,6 @@ consume_from_empty_queue(Config) ->
316
312
consume_empty (Ch , QQ , false ).
317
313
318
314
subscribe_to_queue (Config ) ->
319
- % % Test the node restart with both types of queues (quorum and classic) to
320
- % % ensure there are no regressions
321
315
Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
322
316
323
317
Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
@@ -337,8 +331,6 @@ subscribe_to_queue(Config) ->
337
331
wait_for_messages (Config , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>).
338
332
339
333
subscribe_with_autoack_to_queue (Config ) ->
340
- % % Test the node restart with both types of queues (quorum and classic) to
341
- % % ensure there are no regressions
342
334
Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
343
335
344
336
Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
@@ -362,6 +354,41 @@ subscribe_with_autoack_to_queue(Config) ->
362
354
rabbit_ct_client_helpers :close_channel (Ch ),
363
355
wait_for_messages (Config , QQ , <<" 0" >>, <<" 0" >>, <<" 0" >>).
364
356
357
+ consume_and_ack_from_queue (Config ) ->
358
+ Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
359
+
360
+ Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
361
+ QQ = <<" quorum-q" >>,
362
+ ? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
363
+ declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
364
+
365
+ publish (Ch , QQ ),
366
+ wait_for_messages (Config , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>),
367
+ % % TODO we don't store consumer tag for basic.get!!! could it be fixed?
368
+ DeliveryTag = consume (Ch , QQ , false ),
369
+ wait_for_messages (Config , QQ , <<" 1" >>, <<" 0" >>, <<" 1" >>),
370
+ amqp_channel :cast (Ch , # 'basic.ack' {delivery_tag = DeliveryTag }),
371
+ wait_for_messages (Config , QQ , <<" 0" >>, <<" 0" >>, <<" 0" >>).
372
+
373
+ subscribe_and_ack_to_queue (Config ) ->
374
+ Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
375
+
376
+ Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
377
+ QQ = <<" quorum-q" >>,
378
+ ? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
379
+ declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
380
+
381
+ publish (Ch , QQ ),
382
+ wait_for_messages (Config , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>),
383
+ subscribe (Ch , QQ , false ),
384
+ receive
385
+ {# 'basic.deliver' {delivery_tag = DeliveryTag }, _ } ->
386
+ ok
387
+ end ,
388
+ wait_for_messages (Config , QQ , <<" 1" >>, <<" 0" >>, <<" 1" >>),
389
+ amqp_channel :cast (Ch , # 'basic.ack' {delivery_tag = DeliveryTag }),
390
+ wait_for_messages (Config , QQ , <<" 0" >>, <<" 0" >>, <<" 0" >>).
391
+
365
392
% %----------------------------------------------------------------------------
366
393
367
394
declare (Ch , Q ) ->
@@ -408,9 +435,10 @@ publish(Ch, Queue) ->
408
435
payload = <<" msg" >>}).
409
436
410
437
consume (Ch , Queue , NoAck ) ->
411
- ? assertMatch ({# 'basic.get_ok' {}, # amqp_msg {payload = <<" msg" >>}},
412
- amqp_channel :call (Ch , # 'basic.get' {queue = Queue ,
413
- no_ack = NoAck })).
438
+ {GetOk , _ } = Reply = amqp_channel :call (Ch , # 'basic.get' {queue = Queue ,
439
+ no_ack = NoAck }),
440
+ ? assertMatch ({# 'basic.get_ok' {}, # amqp_msg {payload = <<" msg" >>}}, Reply ),
441
+ GetOk # 'basic.get_ok' .delivery_tag .
414
442
415
443
consume_empty (Ch , Queue , NoAck ) ->
416
444
? assertMatch (# 'basic.get_empty' {},
0 commit comments