@@ -482,12 +482,12 @@ amqp_mqtt(Qos, Config) ->
482482
483483mqtt_stomp_mqtt (Config ) ->
484484 {ok , StompC0 } = stomp_connect (Config ),
485- ok = stomp_send (StompC0 , " SUBSCRIBE" , [{" destination" , " /topic/t.1" },
486- {" receipt" , " my-receipt" },
487- {" id" , " subscription-888" },
488- {" durable" , " true" }]),
489- {# stomp_frame {command = " RECEIPT" ,
490- headers = [{" receipt-id" , " my-receipt" }]}, StompC1 } = stomp_recv (StompC0 ),
485+ ok = stomp_send (StompC0 , ' SUBSCRIBE' , [{<< " destination" >>, << " /topic/t.1" >> },
486+ {<< " receipt" >>, << " my-receipt" >> },
487+ {<< " id" >>, << " subscription-888" >> },
488+ {<< " durable" >>, << " true" >> }]),
489+ {# stomp_frame {command = ' RECEIPT' ,
490+ headers = [{<< " receipt-id" >>,<< " my-receipt" >> }]}, StompC1 } = stomp_recv (StompC0 ),
491491
492492 % % MQTT 5.0 to STOMP 1.2
493493 C = connect (<<" my-mqtt-client" >>, Config ),
@@ -513,40 +513,40 @@ mqtt_stomp_mqtt(Config) ->
513513 'User-Property' => UserProperty },
514514 RequestPayload , [{qos , 1 }]),
515515
516- {# stomp_frame {command = " MESSAGE" ,
516+ {# stomp_frame {command = ' MESSAGE' ,
517517 headers = Headers0 ,
518- body_iolist = Body } = Msg1 , StompC2 } = stomp_recv (StompC1 ),
518+ body_iolist_rev = BodyRev } = Msg1 , StompC2 } = stomp_recv (StompC1 ),
519+ Body = lists :reverse (BodyRev ),
519520 ? assertEqual (RequestPayload , iolist_to_binary (Body )),
520- Headers1 = maps :from_list (Headers0 ),
521- Headers = maps :map (fun (_K , V ) -> unicode :characters_to_binary (V ) end , Headers1 ),
521+ Headers = maps :from_list (Headers0 ),
522522 ct :pal (" Received STOMP 1.2 message:~n~p~n "
523523 " with headers map:~n~p " , [Msg1 , Headers ]),
524524 ? assertMatch (
525- #{" content-type" := ContentType ,
526- " correlation-id" := Correlation ,
527- " destination" := <<" /topic/t.1" >>,
525+ #{<< " content-type" >> := ContentType ,
526+ << " correlation-id" >> := Correlation ,
527+ << " destination" >> := <<" /topic/t.1" >>,
528528 % % With Native STOMP, this should be translated to
529529 % % reply-to: /topic/response.topic
530- " x-reply-to-topic" := <<" response.topic" >>,
531- " subscription" := <<" subscription-888" >>,
532- " persistent" := <<" true" >>,
530+ << " x-reply-to-topic" >> := <<" response.topic" >>,
531+ << " subscription" >> := <<" subscription-888" >>,
532+ << " persistent" >> := <<" true" >>,
533533 % % The STOMP spec mandates headers to be encoded as UTF-8, but unfortunately the RabbitMQ
534534 % % STOMP implementation (as of 3.13) does not adhere and therefore does not provide UTF-8 support.
535- % "rabbit🐇" := <<"carrot🥕"/utf8>>,
536- % "x-rabbit🐇" := <<"carrot🥕"/utf8>>,
537- " key" := <<" val1" >>,
538- " x-key" := <<" val1" >>
535+ % << "rabbit🐇"/utf8>> := <<"carrot🥕"/utf8>>,
536+ % << "x-rabbit🐇"/utf8>> := <<"carrot🥕"/utf8>>,
537+ << " key" >> := <<" val1" >>,
538+ << " x-key" >> := <<" val1" >>
539539 },
540540 Headers ),
541541
542542 % % STOMP 1.2 to MQTT 5.0
543- ok = stomp_send (StompC2 , " SEND" ,
544- [{" destination" , " /topic/response.topic" },
545- {" persistent" , " true" },
546- {" content-type" , " application/json" },
547- {" correlation-id" , binary_to_list ( Correlation ) },
548- {" x-key" , " val4" }],
549- [" {\" my\" : \" response\" }" ]),
543+ ok = stomp_send (StompC2 , ' SEND' ,
544+ [{<< " destination" >>, << " /topic/response.topic" >> },
545+ {<< " persistent" >>, << " true" >> },
546+ {<< " content-type" >>, << " application/json" >> },
547+ {<< " correlation-id" >>, Correlation },
548+ {<< " x-key" >>, << " val4" >> }],
549+ [<< " {\" my\" : \" response\" }" >> ]),
550550 ok = stomp_disconnect (StompC2 ),
551551
552552 receive {publish , MqttMsg } ->
@@ -713,12 +713,12 @@ stomp_connect(Config) ->
713713 Port = rabbit_ct_broker_helpers :get_node_config (Config , 0 , tcp_port_stomp ),
714714 {ok , Sock } = gen_tcp :connect (localhost , Port , [{active , false }, binary ]),
715715 Client0 = {Sock , []},
716- stomp_send (Client0 , " CONNECT" , [{" accept-version" , " 1.2" }]),
717- {# stomp_frame {command = " CONNECTED" }, Client1 } = stomp_recv (Client0 ),
716+ stomp_send (Client0 , ' CONNECT' , [{<< " accept-version" >>, << " 1.2" >> }]),
717+ {# stomp_frame {command = ' CONNECTED' }, Client1 } = stomp_recv (Client0 ),
718718 {ok , Client1 }.
719719
720720stomp_disconnect (Client = {Sock , _ }) ->
721- stomp_send (Client , " DISCONNECT" ),
721+ stomp_send (Client , ' DISCONNECT' ),
722722 gen_tcp :close (Sock ).
723723
724724stomp_send (Client , Command ) ->
@@ -729,9 +729,9 @@ stomp_send(Client, Command, Headers) ->
729729
730730stomp_send ({Sock , _ }, Command , Headers , Body ) ->
731731 Frame = rabbit_stomp_frame :serialize (
732- # stomp_frame {command = list_to_binary ( Command ) ,
733- headers = Headers ,
734- body_iolist = Body }),
732+ # stomp_frame {command = Command ,
733+ headers = Headers ,
734+ body_iolist_rev = Body }),
735735 gen_tcp :send (Sock , Frame ).
736736
737737stomp_recv ({_Sock , []} = Client ) ->
0 commit comments