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

Ric*_*ich 3 amazon-sqs amazon-web-services

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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)

看起来它们都做同样的事情,即指定在获取的消息上应返回哪些属性。有什么区别吗?如果不是,哪个是首选?

Ric*_*ich 5

我现在明白了:

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

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