@@ -397,7 +397,6 @@ mqtt_amqp_alt(_Config) ->
397
397
[{<<" key-2" >>, <<" val-2" >>},
398
398
{<<" key-1" >>, <<" val-1" >>},
399
399
{<<" x-stream-filter" >>, <<" apple" >>}],
400
- % % TODO uuid
401
400
'Correlation-Data' => CorrId ,
402
401
'Message-Expiry-Interval' => 1001 ,
403
402
'Response-Topic' => <<" tmp/blah/responses" >>
@@ -438,9 +437,11 @@ amqp_mqtt(_Config) ->
438
437
thead2 ('x-list' , list , [utf8 (<<" l" >>)]),
439
438
thead2 ('x-map' , map , [{utf8 (<<" k" >>), utf8 (<<" v" >>)}])
440
439
],
440
+ CorrIdOut = <<" urn:uuid:550e8400-e29b-41d4-a716-446655440000" >>,
441
+ {ok , CorrUUId } = mc_util :urn_string_to_uuid (CorrIdOut ),
441
442
M = # 'v1_0.message_annotations' {content = MAC },
442
443
P = # 'v1_0.properties' {content_type = {symbol , <<" text/plain" >>},
443
- correlation_id = {utf8 , << " corr-id " >> },
444
+ correlation_id = {uuid , CorrUUId },
444
445
creation_time = {timestamp , 10000 }
445
446
},
446
447
AC = [
@@ -469,6 +470,7 @@ amqp_mqtt(_Config) ->
469
470
routing_keys => [<<" apple" >>]},
470
471
AMsg = mc :init (mc_amqp , [H , M , P , A , D ], Anns ),
471
472
Msg = mc :convert (mc_mqtt , AMsg , Env ),
473
+ ? assertMatch ({uuid , CorrUUId }, mc :correlation_id (Msg )),
472
474
Mqtt = mc :protocol_state (Msg ),
473
475
? assertMatch (
474
476
# mqtt_msg {qos = 1 ,
@@ -493,11 +495,9 @@ amqp_mqtt(_Config) ->
493
495
{<<" boolean" >>,<<" true" >>},
494
496
{<<" boolean2" >>,<<" false" >>},
495
497
{<<" null" >>,<<>>}],
496
- 'Correlation-Data' := <<" corr-id" >>
497
- % 'Message-Expiry-Interval' := 20000
498
+ 'Correlation-Data' := CorrIdOut
498
499
}
499
500
}, Mqtt ),
500
-
501
501
ok .
502
502
503
503
mqtt_msg () ->
0 commit comments