Home > Back-end >  What's the difference between MessageAttributeValue and MessageSystemAttributeValue
What's the difference between MessageAttributeValue and MessageSystemAttributeValue

Time:05-04

I want to send custom attribute values along with message in the SQS queue. I've come across MessageAttributeValue and MessageSystemAttributeValue. Both have almost same definition in AWS documentation.

What's the difference between them?

MessageAttributeValue documentation MessageSystemAttributeValue documentation

CodePudding user response:

The difference is on the use:

  • Message attribute: You can use message attributes to attach custom metadata to Amazon SQS messages for your applications.
  • Message system attribute: You can use message system attributes to store metadata for other Amazon services (currently, the only supported message system attribute is AWSTraceHeader. And its value must be a correctly formatted Amazon X-Ray trace header string).

CodePudding user response:

MessageAttributes are normal attributes of a message. MessageSystemAttributes are special attributes, and there is only one of those:

Currently, the only supported message system attribute is AWSTraceHeader. Its type must be String and its value must be a correctly formatted AWS X-Ray trace header string.

Which is what you get when you look at the actual usage of the data type within the documentation instead of just looking at the raw data type itself, e.g.: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html

  • Related