diff options
author | Loïc Hoguin <lhoguin@vmware.com> | 2021-12-08 14:09:37 +0100 |
---|---|---|
committer | Loïc Hoguin <lhoguin@vmware.com> | 2021-12-08 14:37:41 +0100 |
commit | 643dc1aa68b83e67e2b71e6f3190de78bd1ce4ea (patch) | |
tree | fb6dc17df88d1f8f515a54a0b49b1f813de0e35e | |
parent | b7cb8614f8deb3338e33462aea741813b22f094d (diff) | |
download | rabbitmq-server-git-lh/mandatory-before-confirms-bug.tar.gz |
Add test checking confirms after a mandatory messagelh/mandatory-before-confirms-bug
-rw-r--r-- | deps/rabbit/test/publisher_confirms_parallel_SUITE.erl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/deps/rabbit/test/publisher_confirms_parallel_SUITE.erl b/deps/rabbit/test/publisher_confirms_parallel_SUITE.erl index 30bc5f8ba6..d76a892be4 100644 --- a/deps/rabbit/test/publisher_confirms_parallel_SUITE.erl +++ b/deps/rabbit/test/publisher_confirms_parallel_SUITE.erl @@ -29,6 +29,7 @@ groups() -> confirm_nowait, confirm_ack, confirm_acks, + confirm_after_mandatory_bug, confirm_mandatory_unroutable, confirm_unroutable_message], [ @@ -187,6 +188,32 @@ confirm_acks(Config) -> publish(Ch, QName, [<<"msg1">>, <<"msg2">>, <<"msg3">>, <<"msg4">>]), receive_many(lists:seq(1, 4)). +confirm_after_mandatory_bug(Config) -> + {_Conn, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), + QName = ?config(queue_name, Config), + declare_queue(Ch, Config, QName), + ok = amqp_channel:call(Ch, #'basic.publish'{routing_key = QName, + mandatory = true}, #amqp_msg{payload = <<"msg0">>}), + amqp_channel:call(Ch, #'confirm.select'{}), +% amqp_channel:register_confirm_handler(Ch, self()), + publish(Ch, QName, [<<"msg1">>, <<"msg2">>, <<"msg3">>, <<"msg4">>]), + amqp_channel:wait_for_confirms(Ch, 5), + ok. +% receive_many(lists:seq(1, 4)). + +%publisher_confirms(Config) -> +% {_Conn, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), +% QName = ?config(queue_name, Config), +% declare_queue(Ch, Config, QName), +% amqp_channel:call(Ch, #'confirm.select'{}), +% amqp_channel:register_confirm_handler(Ch, self()), +% publish(Ch, QName, [<<"msg1">>]), +% wait_for_messages(Config, [[QName, <<"1">>, <<"1">>, <<"0">>]]), +% amqp_channel:wait_for_confirms(Ch, 5), +% amqp_channel:unregister_confirm_handler(Ch), +% ok. + + %% For unroutable messages, the broker will issue a confirm once the exchange verifies a message %% won't route to any queue (returns an empty list of queues). %% If the message is also published as mandatory, the basic.return is sent to the client before |