Skip to content

Commit 9440134

Browse files
committed
Allow transfer without payload
Fixes test ``` ./mvnw test -Dtest=ClientTest#largeMessageWithStreamSender ``` in client rabbitmq-java-model
1 parent 63b3a4f commit 9440134

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

deps/rabbit/src/rabbit_amqp_session.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,12 @@ handle_control({Txfr = #'v1_0.transfer'{handle = ?UINT(Handle)}, MsgPart},
903903
"Unknown link handle: ~p", [Handle])
904904
end;
905905

906+
%% Although the AMQP message format [3.2] requires a body, it is valid to send a transfer frame without payload.
907+
%% For example, when a large multi transfer message is streamed using the ProtonJ2 client, the client could send
908+
%% a final #'v1_0.transfer'{more=false} frame without a payload.
909+
handle_control(Txfr = #'v1_0.transfer'{}, State) ->
910+
handle_control({Txfr, <<>>}, State);
911+
906912
%% Flow control. These frames come with two pieces of information:
907913
%% the session window, and optionally, credit for a particular link.
908914
%% We'll deal with each of them separately.

0 commit comments

Comments
 (0)