@@ -500,37 +500,29 @@ maps_upsert(Key, TaggedVal, KVList) ->
500500
501501encode (Sections ) when is_list (Sections ) ->
502502 [amqp10_framing :encode_bin (Section ) || Section <- Sections ,
503- not is_empty (Section )].
503+ not omit (Section )].
504504
505- is_empty (# 'v1_0.header' {durable = undefined ,
506- priority = undefined ,
507- ttl = undefined ,
508- first_acquirer = undefined ,
509- delivery_count = undefined }) ->
505+ omit (# 'v1_0.message_annotations' {content = []}) ->
510506 true ;
511- is_empty (# 'v1_0.delivery_annotations' {content = []}) ->
507+ omit (# 'v1_0.properties' {message_id = undefined ,
508+ user_id = undefined ,
509+ to = undefined ,
510+ subject = undefined ,
511+ reply_to = undefined ,
512+ correlation_id = undefined ,
513+ content_type = undefined ,
514+ content_encoding = undefined ,
515+ absolute_expiry_time = undefined ,
516+ creation_time = undefined ,
517+ group_id = undefined ,
518+ group_sequence = undefined ,
519+ reply_to_group_id = undefined }) ->
512520 true ;
513- is_empty (# 'v1_0.message_annotations ' {content = []}) ->
521+ omit (# 'v1_0.application_properties ' {content = []}) ->
514522 true ;
515- is_empty (# 'v1_0.properties' {message_id = undefined ,
516- user_id = undefined ,
517- to = undefined ,
518- subject = undefined ,
519- reply_to = undefined ,
520- correlation_id = undefined ,
521- content_type = undefined ,
522- content_encoding = undefined ,
523- absolute_expiry_time = undefined ,
524- creation_time = undefined ,
525- group_id = undefined ,
526- group_sequence = undefined ,
527- reply_to_group_id = undefined }) ->
523+ omit (# 'v1_0.footer' {content = []}) ->
528524 true ;
529- is_empty (# 'v1_0.application_properties' {content = []}) ->
530- true ;
531- is_empty (# 'v1_0.footer' {content = []}) ->
532- true ;
533- is_empty (_ ) ->
525+ omit (_ ) ->
534526 false .
535527
536528message_annotation (Key , State , Default )
0 commit comments