Crabbit::Message
Complete AMQP 1.0 message used as a RabbitMQ Stream payload.
A message can contain header, annotations, properties, application
properties, one body family, footer, and unknown described sections.
Message.new creates a Data-body message; use .data, .sequence, or
.value for explicit body construction.
message = Crabbit::Message.new(
"invoice-created",
properties: Crabbit::Properties.new(content_type: "text/plain"),
application_properties: {
"region" => Crabbit::AMQP::Value.wrap("eu"),
},
)
Constructors
Decodes one complete AMQP message from bytes.
Binary values are copied by default. With zero_copy, Data sections and AMQP binary values may reference bytes directly; the caller must keep that buffer alive and must not mutate it while the message is used.
Instance methods
Returns the mutable application-properties map, creating it when absent.
Returns the logical Data body as bytes.
A single Data part is returned without copying. Multiple parts are joined
into a new slice. Non-Data messages return Bytes.empty.
Returns unknown described sections preserved during decoding.
Values added here are encoded after the standard message sections.
Encodes the complete message directly into io.
This overload avoids allocating an intermediate encoded Bytes buffer.