Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Dec 2, 2025

According to the AMQP spec, a message must have a body.

amqpnetlite and Azure Service Bus support non-compliant AMQP where a message might have no body. RabbitMQ implements the AMQP spec correctly requiring a message body. This commit provides a nice error description if a client wrongly sends a message without a body.

Prior to this commit, the session got terminated with the following non-descriptive error:

[{mc_amqp,msg_body_encoded,
     [[],0,
      {msg_body_encoded,undefined,[],
          {'v1_0.properties',undefined,undefined,undefined,undefined,
              undefined,undefined,undefined,undefined,undefined,undefined,
              undefined,undefined,undefined},
          [],
          <<0,83,115,69>>,
          [],uninit,uninit}],
     [{file,"mc_amqp.erl"},{line,612}]},
 {mc_amqp,init,1,[{file,"mc_amqp.erl"},{line,145}]},
 {mc,init,4,[{file,"mc.erl"},{line,157}]},
 {rabbit_amqp_session,incoming_link_transfer,4,
     [{file,"rabbit_amqp_session.erl"},{line,2409}]},
 {rabbit_amqp_session,handle_frame,2,
     [{file,"rabbit_amqp_session.erl"},{line,983}]},
 {rabbit_amqp_session,handle_cast,2,
     [{file,"rabbit_amqp_session.erl"},{line,558}]},
 {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2460}]},
 {gen_server,handle_msg,3,[{file,"gen_server.erl"},{line,2418}]}]

(Note that transfer frames without payload are allowed though.)


This is an automatic backport of pull request #15048 done by Mergify.

According to the AMQP spec, a message must have a body.

amqpnetlite and Azure Service Bus support non-compliant AMQP where a
message might have no body. RabbitMQ implements the AMQP spec correctly
requiring a message body. This commit provides a nice error description
if a client wrongly sends a message without a body.

Prior to this commit, the session got terminated with the following
non-descriptive error:
```
[{mc_amqp,msg_body_encoded,
     [[],0,
      {msg_body_encoded,undefined,[],
          {'v1_0.properties',undefined,undefined,undefined,undefined,
              undefined,undefined,undefined,undefined,undefined,undefined,
              undefined,undefined,undefined},
          [],
          <<0,83,115,69>>,
          [],uninit,uninit}],
     [{file,"mc_amqp.erl"},{line,612}]},
 {mc_amqp,init,1,[{file,"mc_amqp.erl"},{line,145}]},
 {mc,init,4,[{file,"mc.erl"},{line,157}]},
 {rabbit_amqp_session,incoming_link_transfer,4,
     [{file,"rabbit_amqp_session.erl"},{line,2409}]},
 {rabbit_amqp_session,handle_frame,2,
     [{file,"rabbit_amqp_session.erl"},{line,983}]},
 {rabbit_amqp_session,handle_cast,2,
     [{file,"rabbit_amqp_session.erl"},{line,558}]},
 {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2460}]},
 {gen_server,handle_msg,3,[{file,"gen_server.erl"},{line,2418}]}]
```

(Note that transfer frames without payload are allowed though.)

(cherry picked from commit 8d7d291)
@mergify mergify bot assigned ansd Dec 2, 2025
@michaelklishin michaelklishin added this to the 4.2.2 milestone Dec 2, 2025
@michaelklishin michaelklishin merged commit 801c0d4 into v4.2.x Dec 2, 2025
576 of 577 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-15048 branch December 2, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants