[英]Where are AWS SQS message built-in message attributes documented?
I'm sending messages to AWS SQS with the Node.js SDK.我正在使用 Node.js SDK 向 AWS SQS 发送消息。 I cannot find the documentation that lists the various built-in attributes that can be specified in a message.
我找不到列出可以在消息中指定的各种内置属性的文档。 The example in the documentation specifies an attribute called "DelaySeconds", but I don't see where that is documented anywhere??
文档中的示例指定了一个名为“DelaySeconds”的属性,但我在任何地方都看不到该属性的记录??
Presumably that instructs the SDK to wait n seconds before sending the message?大概是指示 SDK 在发送消息之前等待 n 秒? I'm trying to get the full list of Attributes I'm allowed to specify in a message.
我正在尝试获取允许在消息中指定的属性的完整列表。 Note: I'm not referring to the MessageAttributes where I can specify my own message attributes, I'm referring to attributes that AWS looks at, such as MessageBody, QueueURL, DelaySeconds, etc.
注意:我不是指可以在其中指定我自己的消息属性的 MessageAttributes,而是指 AWS 查看的属性,例如 MessageBody、QueueURL、DelaySeconds 等。
Here is link to documentation I'm looking at: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sqs-examples-send-receive-messages.html这是我正在查看的文档的链接: https : //docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sqs-examples-send-receive-messages.html
Full Example code here:完整示例代码在这里:
// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set the region
AWS.config.update({region: 'REGION'});
// Create an SQS service object
var sqs = new AWS.SQS({apiVersion: '2012-11-05'});
var params = {
DelaySeconds: 10, <--- where is this documented?
MessageAttributes: {
"Title": {
DataType: "String",
StringValue: "The Whistler"
},
"Author": {
DataType: "String",
StringValue: "John Grisham"
},
"WeeksOn": {
DataType: "Number",
StringValue: "6"
}
},
MessageBody: "Information about current NY Times fiction bestseller for week of 12/11/2016.",
// MessageDeduplicationId: "TheWhistler", // Required for FIFO queues
// MessageId: "Group1", // Required for FIFO queues
QueueUrl: "SQS_QUEUE_URL"
};
sqs.sendMessage(params, function(err, data) {
if (err) {
console.log("Error", err);
} else {
console.log("Success", data.MessageId);
}
});
I found documentation here, was linked from page, just didnt see it.我在这里找到了文档,是从页面链接的,只是没有看到。 https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#sendMessage-property
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#sendMessage-property
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.