@@ -156,7 +156,8 @@ groups() ->
156156 tcp_back_pressure_rabbitmq_internal_flow_quorum_queue ,
157157 session_max_per_connection ,
158158 link_max_per_session ,
159- reserved_annotation
159+ reserved_annotation ,
160+ open_properties_queue_prefix
160161 ]},
161162
162163 {cluster_size_3 , [shuffle ],
@@ -4762,7 +4763,7 @@ dead_letter_headers_exchange(Config) ->
47624763 #{arguments => #{<<" x-dead-letter-exchange" >> => {utf8 , <<" amq.headers" >>},
47634764 <<" x-message-ttl" >> => {ulong , 0 }}}),
47644765 {ok , _ } = rabbitmq_amqp_client :declare_queue (LinkPair , QName2 , #{}),
4765- ok = rabbitmq_amqp_client :bind_queue (LinkPair , QName2 , <<" amq.headers" >>, <<>>,
4766+ ok = rabbitmq_amqp_client :bind_queue (LinkPair , QName2 , <<" amq.headers" >>, <<>>,
47664767 #{<<" my key" >> => {uint , 5 },
47674768 <<" x-my key" >> => {uint , 6 },
47684769 <<" x-match" >> => {utf8 , <<" all-with-x" >>}}),
@@ -5944,6 +5945,45 @@ reserved_annotation(Config) ->
59445945 end ,
59455946 ok = close_connection_sync (Connection ).
59465947
5948+ % % Test case for https://github.com/rabbitmq/rabbitmq-server/issues/12531.
5949+ % % We pretend here to be unaware of RabbitMQ's target and source address format.
5950+ % % We learn the address format from the properties field in the open frame.
5951+ open_properties_queue_prefix (Config ) ->
5952+ QName = atom_to_binary (? FUNCTION_NAME ),
5953+
5954+ OpnConf0 = connection_config (Config ),
5955+ OpnConf = OpnConf0 #{notify_with_performative => true },
5956+ {ok , Connection } = amqp10_client :open_connection (OpnConf ),
5957+ QueuePrefix = receive {amqp10_event , {connection , Connection ,
5958+ {opened , # 'v1_0.open' {properties = {map , KVList }}}}} ->
5959+ {_ , {utf8 , QPref }} = proplists :lookup ({symbol , <<" queue-prefix" >>}, KVList ),
5960+ QPref
5961+ after 5000 -> ct :fail ({missing_event , ? LINE })
5962+ end ,
5963+
5964+ {ok , Session } = amqp10_client :begin_session_sync (Connection ),
5965+ {ok , LinkPair } = rabbitmq_amqp_client :attach_management_link_pair_sync (Session , <<" my link pair" >>),
5966+ {ok , _ } = rabbitmq_amqp_client :declare_queue (LinkPair , QName , #{}),
5967+
5968+ Address = <<QueuePrefix /binary , QName /binary >>,
5969+ {ok , Sender } = amqp10_client :attach_sender_link (Session , <<" sender" >>, Address , unsettled ),
5970+ {ok , Receiver } = amqp10_client :attach_receiver_link (Session , <<" receiver" >>, Address , unsettled ),
5971+ wait_for_credit (Sender ),
5972+
5973+ ok = amqp10_client :send_msg (Sender , amqp10_msg :new (<<" tag" >>, <<" msg" >>)),
5974+ ok = wait_for_accepted (<<" tag" >>),
5975+
5976+ {ok , Msg } = amqp10_client :get_msg (Receiver ),
5977+ ? assertEqual ([<<" msg" >>], amqp10_msg :body (Msg )),
5978+ ok = amqp10_client :accept_msg (Receiver , Msg ),
5979+
5980+ ok = amqp10_client :detach_link (Sender ),
5981+ ok = amqp10_client :detach_link (Receiver ),
5982+ {ok , _ } = rabbitmq_amqp_client :delete_queue (LinkPair , QName ),
5983+ ok = rabbitmq_amqp_client :detach_management_link_pair_sync (LinkPair ),
5984+ ok = end_session_sync (Session ),
5985+ ok = amqp10_client :close_connection (Connection ).
5986+
59475987% % internal
59485988% %
59495989
0 commit comments