Closed deissnerk closed 7 months ago
FWIW, sdk-go
uses github.com/Azure/go-amqp
which itself in GetData()
returns the first data
slice of Data [][]byte
Thanks, I am currently experimenting with Rust and there the Body
is defined as an enum where Data
essentially is TransparentVec<ByteBuf>
. So I was wondering what the reasoning behind allowing multiple data segments in an AMQP message is, and if we need some clarification for the AMQP binding.
@embano1 We discussed this on last week's call. It seems that all data sections of a message need to be concatenated. I suppose that in practice, it does not occur often, but a message might span multiple AMQP frames. I'm not deeply familiar with these details of the AMQP protocol, but I assume that the possibility of having multiple data sections is exactly for this case. I opened an issue on github.com/Azure/go-amqp
for clarification.
Thx, keep us posted, because might require changes to our SDK(s)
@embano1 I got an answer. For details, please refer to the issue linked above.
@deissnerk FYI https://github.com/cloudevents/sdk-go/pull/1034
My initial question has been answered. Multiple data sections are simply a feature of AMQP, but semantically it remains one payload of the message. Therefore, concatenating seems to be the right behavior.
The AMQP spec states:
If I understand the AMQP binding for CloudEvents correctly, we only make use of the data section and not the
amqp-sequence
or theamqp-value
, but how are multiple data sections supposed to be treated? Should an implementation always only consider the first, or should multiple data sections be concatenated?@clemensv