Skip to content

Commit 07db2f2

Browse files
dcorbachomergify[bot]
authored andcommitted
Shovel AMQP091 bugfix: basic.cancel is a source message
It is the source side of the shovel that must handle the basic.cancel message from the source queue. This fix makes 091-10 and 091-local work, handling the basic.cancel and restarting the shovel when required. (cherry picked from commit 402e5b7)
1 parent 0fc2405 commit 07db2f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deps/rabbitmq_shovel/src/rabbit_amqp091_shovel.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ handle_source({#'basic.deliver'{delivery_tag = Tag,
229229
% forward to destination
230230
rabbit_shovel_behaviour:forward(Tag, Msg, State);
231231

232+
handle_source(#'basic.cancel'{}, #{name := Name}) ->
233+
?LOG_WARNING("Shovel ~tp received a 'basic.cancel' from the server", [Name]),
234+
{stop, {shutdown, restart}};
235+
232236
handle_source({'EXIT', Conn, Reason},
233237
#{source := #{current := {Conn, _, _}}}) ->
234238
{stop, {inbound_conn_died, Reason}};
@@ -251,10 +255,6 @@ handle_dest(#'basic.nack'{delivery_tag = Seq, multiple = Multiple},
251255
rabbit_shovel_behaviour:nack(Tag, Multi, StateX)
252256
end, Seq, Multiple, State);
253257

254-
handle_dest(#'basic.cancel'{}, #{name := Name}) ->
255-
?LOG_WARNING("Shovel ~tp received a 'basic.cancel' from the server", [Name]),
256-
{stop, {shutdown, restart}};
257-
258258
handle_dest({'EXIT', Conn, Reason}, #{dest := #{current := {Conn, _, _}}}) ->
259259
{stop, {outbound_conn_died, Reason}};
260260

0 commit comments

Comments
 (0)