@@ -33,7 +33,8 @@ groups() ->
3333 mqtt_amqp ,
3434 mqtt_amqp_alt ,
3535 amqp_mqtt ,
36- is_persistent
36+ is_persistent ,
37+ amqpl_to_mqtt_gh_12707
3738 ]}
3839 ].
3940
@@ -160,6 +161,34 @@ roundtrip_amqpl(_Config) ->
160161 ExpectedUserProperty = lists :keysort (1 , UserProperty ),
161162 ? assertMatch (#{'User-Property' := ExpectedUserProperty }, Props ).
162163
164+ amqpl_to_mqtt_gh_12707 (_Config ) ->
165+ Props = # 'P_basic' {content_type = <<" text/plain" >>,
166+ content_encoding = <<" gzip" >>,
167+ headers = [],
168+ delivery_mode = 1 ,
169+ priority = 7 ,
170+ correlation_id = <<" gh_12707-corr" >> ,
171+ reply_to = <<" reply-to" >>,
172+ expiration = <<" 12707" >>,
173+ message_id = <<" msg-id" >>,
174+ timestamp = 99 ,
175+ type = <<" 45" >>,
176+ user_id = <<" gh_12707" >>,
177+ app_id = <<" rmq" >>
178+ },
179+ Payload = [<<" gh_12707" >>],
180+ Content = # content {properties = Props ,
181+ payload_fragments_rev = Payload },
182+ Content = # content {properties = Props ,
183+ payload_fragments_rev = Payload },
184+ Anns = #{
185+ ? ANN_EXCHANGE => <<" amq.topic" >>,
186+ ? ANN_ROUTING_KEYS => [<<" dummy" >>]
187+ },
188+ OriginalMsg = mc :init (mc_amqpl , Content , Anns ),
189+ Converted = mc :convert (mc_mqtt , OriginalMsg ),
190+ ? assertEqual (12707 , mc :get_annotation (ttl , Converted )).
191+
163192% % Non-UTF-8 Correlation Data should also be converted (via AMQP 0.9.1 header x-correlation-id).
164193roundtrip_amqpl_correlation (_Config ) ->
165194 Msg0 = mqtt_msg (),
0 commit comments