Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
proton-c-0.28.0
-
None
Description
To create the smallest "on the wire" AMQP message using proton-c:
char *buffer[10000]'
pn_message_t *pn_msg = pn_message();
size_t size = 10000;
int result = pn_message_encode(pn_msg, buffer, &size);
results in an encoded message of 8 bytes:
(gdb) p result
$1 = 0
(gdb) p size
$2 = 8
(gdb) x/8xb buffer
0x60f280 <buffer>: 0x00 0x53 0x70 0x45 0x00 0x53 0x73 0x45
The encoded message consists of:
1) a Header section composed of a null list
2) a Properties section composed of a null list
Note there is no body section.
However, from the AMQP 1.0 spec Message Format section:
The exact structure of a message, together with its encoding, is defined by the message format. This document defines the structure and semantics of message format 0 (MESSAGE-FORMAT). Altogether a message consists of the following sections:
Zero or one header sections.
Zero or one delivery-annotation sections.
Zero or one message-annotation sections.
Zero or one properties sections.
Zero or one application-properties sections.
The body consists of one of the following three choices: one or more data sections, one or more amqp-sequence sections, or a single amqp-value section.
Zero or one footer sections.
So while the null header and property sections are legal (though unnecessary), the real issue is the lack of a body section.
I would've expected at least a body section 0x77 containing a NULL, or a 0x76 with a NULL list.