Azure / go-amqp

AMQP 1.0 client library for Go.
https://github.com/Azure/go-amqp
MIT License
110 stars 58 forks source link

`GetData()` only returns the first data segment #325

Closed deissnerk closed 7 months ago

deissnerk commented 7 months ago

An AMQP message may contain multiple data sections, but GetData() only returns the first. We discussed this in the context of the CloudEvents AMQP binding and concluded that all data sections need to be concatenated. Is there a reason for only returning the first segment? https://github.com/Azure/go-amqp/blob/1003610b1e679a884a60f9011c37e55c6eb07338/message.go#L125

jhendrixMSFT commented 7 months ago

It was a helper used by our old event hubs and service bus SDKs. Removing/changing it would have been a breaking change, so we left it as-is.

It's best to just directly access the Data field.

deissnerk commented 7 months ago

Thank you @jhendrixMSFT