SQS ReceiveMessage中的“ MessageAttributeName.N”和“ AttributeName.N”有什么区别

时间:2019-06-20 08:44:46

标签: amazon-web-services amazon-sqs

SQS“ ReceiveMessage”端点具有两个似乎做相同事情的参数,而且我不理解API文档。有人可以解释其中的区别:

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html

AttributeName.N
A list of attributes that need to be returned along with each message
MessageAttributeName.N
The name of the message attribute, where N is the index.
...
When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all of the attributes by specifying All

似乎它们都做相同的事情,即指定应在获取的消息上返回哪些属性。 有什么区别吗?如果没有,那是首选?

1 个答案:

答案 0 :(得分:1)

我现在看到了:

AttributeName返回AWS的属性,例如“ roximatefirstreceivetimestamp”

MessageAttributeName返回消息(用户指定)属性