我正在使用aws-sdk-js将消息发送到AWS中的标准队列。下面是有效载荷,
{
MessageBody: 'UUID',
QueueUrl: 'https://sqs.eu-west-1.amazonaws.com/<account>/<queue-name>',
DelaySeconds: 0,
MessageAttributes: {
attribute1: {
StringValue: 'UUID',
StringListValues: [],
BinaryListValues: [],
DataType: 'String'
},
attribute2: {
StringValue: 'SQS',
StringListValues: [],
BinaryListValues: [],
DataType: 'String'
},
attribute3: {
StringValue: 'UUID',
StringListValues: [],
BinaryListValues: [],
DataType: 'String'
}
}
}代码片段,
const AWS = require('aws-sdk');
const sqs = new AWS.SQS();
const params = { /* the above object */ }
sqs.sendMessage(params).promise();但是我得到了这个错误,
AWS.SimpleQueueService.UnsupportedOperation: Message attribute list values in SendMessage operation are not supported.错误是什么?我需要把有效载荷串起来吗?
发布于 2021-07-19 13:35:47
您还没有给出生成消息的代码,所以很难判断不支持的值是如何进入有效负载的。
但是,没有用于消息属性值的“列表”dataType。aws docs。唯一支持的dataTypes是
在消息有效负载中,下面两个字段的值是列表dataTypes
StringListValues: [],
BinaryListValues: [],您应该删除它们。
https://stackoverflow.com/questions/68433213
复制相似问题