Skip to content

Commit 399659b

Browse files
Merge pull request #10510 from esl/remove-delivery-mode-2
Remove delivery_mode header from amqp 1.0 shovel.
2 parents adbb2c6 + 792e0a1 commit 399659b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

deps/rabbitmq_shovel/src/rabbit_amqp10_shovel.erl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,11 @@ set_message_properties(Props, Msg) ->
390390
#{content_encoding => to_binary(Ct)}, M);
391391
(delivery_mode, 2, M) ->
392392
amqp10_msg:set_headers(#{durable => true}, M);
393+
(delivery_mode, 1, M) ->
394+
% by default the durable flag is false
395+
M;
396+
(priority, P, M) when is_integer(P) ->
397+
amqp10_msg:set_headers(#{priority => P}, M);
393398
(correlation_id, Ct, M) ->
394399
amqp10_msg:set_properties(#{correlation_id => to_binary(Ct)}, M);
395400
(reply_to, Ct, M) ->

deps/rabbitmq_shovel/test/amqp10_dynamic_SUITE.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,15 @@ test_amqp10_destination(Config, Src, Dest, Sess, Protocol, ProtocolSrc) ->
131131
<<"message-ann-value">>}]
132132
end}]),
133133
Msg = publish_expect(Sess, Src, Dest, <<"tag1">>, <<"hello">>),
134+
AppProps = amqp10_msg:application_properties(Msg),
135+
134136
?assertMatch((#{user_id := <<"guest">>, creation_time := _}),
135137
(amqp10_msg:properties(Msg))),
136138
?assertMatch((#{<<"shovel-name">> := <<"test">>,
137139
<<"shovel-type">> := <<"dynamic">>, <<"shovelled-by">> := _,
138140
<<"app-prop-key">> := <<"app-prop-value">>}),
139-
(amqp10_msg:application_properties(Msg))),
141+
(AppProps)),
142+
?assertEqual(undefined, maps:get(<<"delivery_mode">>, AppProps, undefined)),
140143
?assertMatch((#{<<"message-ann-key">> := <<"message-ann-value">>}),
141144
(amqp10_msg:message_annotations(Msg))).
142145

0 commit comments

Comments
 (0)