繁体   English   中英

MessageAttributeValue 和 MessageSystemAttributeValue 有什么区别

[英]What's the difference between MessageAttributeValue and MessageSystemAttributeValue

我想在 SQS 队列中发送自定义属性值和消息。 我遇到过 MessageAttributeValue 和 MessageSystemAttributeValue。 两者在 AWS 文档中的定义几乎相同。

它们之间有什么区别?

MessageAttributeValue 文档MessageSystemAttributeValue 文档

区别在于使用:

  • 消息属性:您可以使用消息属性将自定义元数据附加到应用程序的 Amazon SQS 消息。
  • 消息系统属性:您可以使用消息系统属性存储其他亚马逊服务的元数据(目前,唯一支持的消息系统属性是 AWSTraceHeader。它的值必须是格式正确的 Amazon X-Ray trace header 字符串)。

MessageAttribute是消息的普通属性。 MessageSystemAttribute是特殊属性,只有其中之一:

目前,唯一受支持的消息系统属性是AWSTraceHeader 其类型必须是String ,其值必须是格式正确的 AWS X-Ray trace header 字符串。

当您查看文档中数据类型的实际使用情况而不是仅仅查看原始数据类型本身时,您会得到什么,例如: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/ API_SendMessage.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM